PadSimple configuration now fully works on linux

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3440 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-06-14 10:01:01 +00:00
parent 0609a1fa9e
commit 955e446e91

View File

@ -15,7 +15,7 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "ConfigDlg.h" #include "ConfigDlg.h"
#include "../PadSimple.h" #include "../PadSimple.h"
@ -334,6 +334,7 @@ void ConfigDialog::OnClose(wxCloseEvent& event)
void ConfigDialog::OnKeyDown(wxKeyEvent& event) void ConfigDialog::OnKeyDown(wxKeyEvent& event)
{ {
char keyStr[10] = {0};
if(ClickedButton != NULL) if(ClickedButton != NULL)
{ {
// Get the selected notebook page // Get the selected notebook page
@ -345,7 +346,6 @@ void ConfigDialog::OnKeyDown(wxKeyEvent& event)
{ {
if(m_dinput.diks[i]) if(m_dinput.diks[i])
{ {
char keyStr[10] = {0};
// Save the mapped key, the wxButtons have the Id 0 to 21 // Save the mapped key, the wxButtons have the Id 0 to 21
pad[page].keyForControl[ClickedButton->GetId()] = i; pad[page].keyForControl[ClickedButton->GetId()] = i;
// Get the key name // Get the key name
@ -356,13 +356,15 @@ void ConfigDialog::OnKeyDown(wxKeyEvent& event)
} }
#elif defined(HAVE_X11) && HAVE_X11 #elif defined(HAVE_X11) && HAVE_X11
pad[page].keyForControl[ClickedButton->GetId()] = wxCharCodeWXToX(event.GetKeyCode()); pad[page].keyForControl[ClickedButton->GetId()] = wxCharCodeWXToX(event.GetKeyCode());
ClickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode()));
XKeyToString(pad[page].keyForControl[ClickedButton->GetId()], keyStr);
ClickedButton->SetLabel(wxString::FromAscii(keyStr));
#endif #endif
ClickedButton->Disconnect(); ClickedButton->Disconnect();
} }
// Reset // Reset
ClickedButton = NULL; ClickedButton = NULL;
event.Skip(); //event.Skip();
} }
// We have clicked a button // We have clicked a button