linux port of simplepad dialog

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@683 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2008-09-25 09:15:34 +00:00
parent df27789fe9
commit 6d872a6be5
4 changed files with 31 additions and 27 deletions

View File

@ -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),

View File

@ -29,7 +29,9 @@
#include <wx/panel.h>
#include <wx/gbsizer.h>
#ifndef _WIN32
#include "../XInputBase.h"
#endif
#undef CONFIGDIALOG_STYLE
#define CONFIGDIALOG_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX

View File

@ -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;

View File

@ -10,6 +10,7 @@ else:
files = [
"PadSimple.cpp",
"XInputBase.cpp",
"GUI/ConfigDlg.cpp",
]