diff --git a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp index b00d6145af..d0dd0350d8 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp @@ -82,7 +82,7 @@ inline void AddControl(wxPanel *pan, wxButton **button, wxStaticBoxSizer *sizer, #ifdef _WIN32 DInput::DIKToString(pad[controller].keyForControl[ctl], keyStr); #else - sprintf(keyStr, "%c", pad[controller].keyForControl[ctl]); + XKeyToString(pad[controller].keyForControl[ctl], keyStr); #endif *button = new wxButton(pan, ctl, wxString::FromAscii(keyStr), @@ -230,7 +230,7 @@ void ConfigDialog::OnKeyDown(wxKeyEvent& event) } } #else - pad[page].keyForControl[clickedButton->GetId()] = event.GetKeyCode(); + pad[page].keyForControl[clickedButton->GetId()] = wxCharCodeWXToX(event.GetKeyCode()); #endif clickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode())); clickedButton->Disconnect(); @@ -270,7 +270,7 @@ void ConfigDialog::OnButtonClick(wxCommandEvent& event) } clickedButton = (wxButton *)event.GetEventObject(); oldLabel = clickedButton->GetLabel(); - clickedButton->SetLabel(wxString::FromAscii("Press Key")); + clickedButton->SetLabel(_("Press Key")); clickedButton->Connect(wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(ConfigDialog::OnKeyDown), diff --git a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h index e295574b64..7c86f68cc3 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h +++ b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h @@ -29,7 +29,9 @@ #include #include - +#ifndef _WIN32 +#include "../XInputBase.h" +#endif #undef CONFIGDIALOG_STYLE #define CONFIGDIALOG_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX diff --git a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp index 12520ad9c1..b9c5f1ac6e 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp +++ b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp @@ -637,29 +637,30 @@ void LoadConfig() #else const int defaultKeyForControl[NUMCONTROLS] = { - XK_Left, //mainstick - XK_Up, - XK_Right, - XK_Down, - XK_j, //substick - XK_i, - XK_l, - XK_k, - XK_f, //dpad - XK_t, - XK_h, - XK_g, - XK_x, //buttons - XK_z, - XK_s, - XK_c, - XK_d, - XK_q, - XK_w, - XK_Return, - XK_Shift_L, - XK_Shift_L, - XK_Control_L + XK_x, //A + XK_z, + XK_s, + XK_c, + XK_d, + XK_Return, + XK_q, + XK_Control_L, + XK_w, + XK_Control_L, + XK_Up, //mainstick + XK_Down, + XK_Left, + XK_Right, + XK_Shift_L, + XK_i, //substick + XK_K, + XK_j, + XK_l, + XK_Shift_L, + XK_t, //dpad + XK_g, + XK_f, + XK_h }; #endif IniFile file; diff --git a/Source/Plugins/Plugin_PadSimple/Src/SConscript b/Source/Plugins/Plugin_PadSimple/Src/SConscript index 2f04c504e4..d00657d917 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/SConscript +++ b/Source/Plugins/Plugin_PadSimple/Src/SConscript @@ -10,6 +10,7 @@ else: files = [ "PadSimple.cpp", + "XInputBase.cpp", "GUI/ConfigDlg.cpp", ]