(windows)padsimple now shows human-readable names after you set a new key
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@692 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
c1b340feb5
commit
3055091932
|
@ -72,9 +72,10 @@ ConfigDialog::~ConfigDialog()
|
|||
}
|
||||
|
||||
inline void AddControl(wxPanel *pan, wxButton **button, wxStaticBoxSizer *sizer,
|
||||
const char *name, int ctl, int controller) {
|
||||
const char *name, int ctl, int controller)
|
||||
{
|
||||
wxBoxSizer *hButton = new wxBoxSizer(wxHORIZONTAL);
|
||||
char keyStr[6] = {0};
|
||||
char keyStr[10] = {0};
|
||||
|
||||
hButton->Add(new wxStaticText(pan, 0, wxString::FromAscii(name),
|
||||
wxDefaultPosition, wxDefaultSize), 0,
|
||||
|
@ -88,8 +89,6 @@ inline void AddControl(wxPanel *pan, wxButton **button, wxStaticBoxSizer *sizer,
|
|||
*button = new wxButton(pan, ctl, wxString::FromAscii(keyStr),
|
||||
wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
||||
hButton->Add(*button, 0, wxEXPAND|wxALL);
|
||||
|
||||
sizer->Add(hButton);
|
||||
}
|
||||
|
||||
|
@ -226,13 +225,16 @@ void ConfigDialog::OnKeyDown(wxKeyEvent& event)
|
|||
{
|
||||
if(m_dinput.diks[i])
|
||||
{
|
||||
char keyStr[10] = {0};
|
||||
pad[page].keyForControl[clickedButton->GetId()] = i;
|
||||
DInput::DIKToString(i, keyStr);
|
||||
clickedButton->SetLabel(wxString::FromAscii(keyStr));
|
||||
}
|
||||
}
|
||||
#else
|
||||
pad[page].keyForControl[clickedButton->GetId()] = wxCharCodeWXToX(event.GetKeyCode());
|
||||
#endif
|
||||
clickedButton->SetLabel(wxString::Format(_T("%c"), event.GetKeyCode()));
|
||||
#endif
|
||||
clickedButton->Disconnect();
|
||||
}
|
||||
|
||||
|
@ -275,7 +277,4 @@ void ConfigDialog::OnButtonClick(wxCommandEvent& event)
|
|||
clickedButton->Connect(wxID_ANY, wxEVT_KEY_DOWN,
|
||||
wxKeyEventHandler(ConfigDialog::OnKeyDown),
|
||||
(wxObject*)NULL, this);
|
||||
|
||||
//clickedButton->SetLabel(wxString::Format(wxT("%i"), keyPress));
|
||||
//clickedButton->SetLabel(wxString::Format(wxT("%s %i"), oldLabel, keyPress));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue