HotkeyDlg: Fix keypress event binding

Previously no keypresses would be recognized during the button press phase.
This commit is contained in:
Lioncash 2015-05-10 03:34:55 -04:00
parent 78e59d08fe
commit fcaaa9f649
1 changed files with 1 additions and 3 deletions

View File

@ -48,7 +48,6 @@ void HotkeyConfigDialog::SaveButtonMapping(int Id, int Key, int Modkey)
void HotkeyConfigDialog::EndGetButtons() void HotkeyConfigDialog::EndGetButtons()
{ {
Unbind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
m_ButtonMappingTimer.Stop(); m_ButtonMappingTimer.Stop();
GetButtonWaitingTimer = 0; GetButtonWaitingTimer = 0;
GetButtonWaitingID = 0; GetButtonWaitingID = 0;
@ -162,8 +161,6 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event)
if (m_ButtonMappingTimer.IsRunning()) if (m_ButtonMappingTimer.IsRunning())
return; return;
Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
// Get the button // Get the button
ClickedButton = (wxButton *)event.GetEventObject(); ClickedButton = (wxButton *)event.GetEventObject();
SetEscapeId(wxID_CANCEL); SetEscapeId(wxID_CANCEL);
@ -328,6 +325,7 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls()
m_Button_Hotkeys[i] = new wxButton(Page, i, wxEmptyString, wxDefaultPosition, size); m_Button_Hotkeys[i] = new wxButton(Page, i, wxEmptyString, wxDefaultPosition, size);
m_Button_Hotkeys[i]->SetFont(m_SmallFont); m_Button_Hotkeys[i]->SetFont(m_SmallFont);
m_Button_Hotkeys[i]->SetToolTip(_("Left click to detect hotkeys.\nEnter space to clear.")); m_Button_Hotkeys[i]->SetToolTip(_("Left click to detect hotkeys.\nEnter space to clear."));
m_Button_Hotkeys[i]->Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
SetButtonText(i, SetButtonText(i,
WxUtils::WXKeyToString(SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[i]), WxUtils::WXKeyToString(SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[i]),
WxUtils::WXKeymodToString( WxUtils::WXKeymodToString(