mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -82,7 +82,7 @@ inline void AddControl(wxPanel *pan, wxButton **button, wxStaticBoxSizer *sizer,
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
DInput::DIKToString(pad[controller].keyForControl[ctl], keyStr);
|
DInput::DIKToString(pad[controller].keyForControl[ctl], keyStr);
|
||||||
#else
|
#else
|
||||||
sprintf(keyStr, "%c", pad[controller].keyForControl[ctl]);
|
XKeyToString(pad[controller].keyForControl[ctl], keyStr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*button = new wxButton(pan, ctl, wxString::FromAscii(keyStr),
|
*button = new wxButton(pan, ctl, wxString::FromAscii(keyStr),
|
||||||
@ -230,7 +230,7 @@ void ConfigDialog::OnKeyDown(wxKeyEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
pad[page].keyForControl[clickedButton->GetId()] = event.GetKeyCode();
|
pad[page].keyForControl[clickedButton->GetId()] = wxCharCodeWXToX(event.GetKeyCode());
|
||||||
#endif
|
#endif
|
||||||
clickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode()));
|
clickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode()));
|
||||||
clickedButton->Disconnect();
|
clickedButton->Disconnect();
|
||||||
@ -270,7 +270,7 @@ void ConfigDialog::OnButtonClick(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
clickedButton = (wxButton *)event.GetEventObject();
|
clickedButton = (wxButton *)event.GetEventObject();
|
||||||
oldLabel = clickedButton->GetLabel();
|
oldLabel = clickedButton->GetLabel();
|
||||||
clickedButton->SetLabel(wxString::FromAscii("Press Key"));
|
clickedButton->SetLabel(_("Press Key"));
|
||||||
|
|
||||||
clickedButton->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
clickedButton->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
||||||
wxKeyEventHandler(ConfigDialog::OnKeyDown),
|
wxKeyEventHandler(ConfigDialog::OnKeyDown),
|
||||||
|
@ -29,7 +29,9 @@
|
|||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
#include <wx/gbsizer.h>
|
#include <wx/gbsizer.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include "../XInputBase.h"
|
||||||
|
#endif
|
||||||
#undef CONFIGDIALOG_STYLE
|
#undef CONFIGDIALOG_STYLE
|
||||||
#define CONFIGDIALOG_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
|
#define CONFIGDIALOG_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
|
||||||
|
|
||||||
|
@ -637,29 +637,30 @@ void LoadConfig()
|
|||||||
#else
|
#else
|
||||||
const int defaultKeyForControl[NUMCONTROLS] =
|
const int defaultKeyForControl[NUMCONTROLS] =
|
||||||
{
|
{
|
||||||
XK_Left, //mainstick
|
XK_x, //A
|
||||||
XK_Up,
|
XK_z,
|
||||||
XK_Right,
|
XK_s,
|
||||||
XK_Down,
|
XK_c,
|
||||||
XK_j, //substick
|
XK_d,
|
||||||
XK_i,
|
XK_Return,
|
||||||
XK_l,
|
XK_q,
|
||||||
XK_k,
|
XK_Control_L,
|
||||||
XK_f, //dpad
|
XK_w,
|
||||||
XK_t,
|
XK_Control_L,
|
||||||
XK_h,
|
XK_Up, //mainstick
|
||||||
XK_g,
|
XK_Down,
|
||||||
XK_x, //buttons
|
XK_Left,
|
||||||
XK_z,
|
XK_Right,
|
||||||
XK_s,
|
XK_Shift_L,
|
||||||
XK_c,
|
XK_i, //substick
|
||||||
XK_d,
|
XK_K,
|
||||||
XK_q,
|
XK_j,
|
||||||
XK_w,
|
XK_l,
|
||||||
XK_Return,
|
XK_Shift_L,
|
||||||
XK_Shift_L,
|
XK_t, //dpad
|
||||||
XK_Shift_L,
|
XK_g,
|
||||||
XK_Control_L
|
XK_f,
|
||||||
|
XK_h
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
IniFile file;
|
IniFile file;
|
||||||
|
@ -10,6 +10,7 @@ else:
|
|||||||
|
|
||||||
files = [
|
files = [
|
||||||
"PadSimple.cpp",
|
"PadSimple.cpp",
|
||||||
|
"XInputBase.cpp",
|
||||||
"GUI/ConfigDlg.cpp",
|
"GUI/ConfigDlg.cpp",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user