Merge pull request #2287 from lioncash/hkbinds

HotkeyDlg: Get rid of application-wide event bindings.
This commit is contained in:
skidau 2015-04-16 11:59:24 +10:00
commit 221d37ae83

View File

@ -57,7 +57,7 @@ void HotkeyConfigDialog::SaveButtonMapping(int Id, int Key, int Modkey)
void HotkeyConfigDialog::EndGetButtons() void HotkeyConfigDialog::EndGetButtons()
{ {
wxTheApp->Unbind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this); Unbind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
m_ButtonMappingTimer.Stop(); m_ButtonMappingTimer.Stop();
GetButtonWaitingTimer = 0; GetButtonWaitingTimer = 0;
GetButtonWaitingID = 0; GetButtonWaitingID = 0;
@ -171,7 +171,7 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event)
if (m_ButtonMappingTimer.IsRunning()) if (m_ButtonMappingTimer.IsRunning())
return; return;
wxTheApp->Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this); Bind(wxEVT_KEY_DOWN, &HotkeyConfigDialog::OnKeyDown, this);
// Get the button // Get the button
ClickedButton = (wxButton *)event.GetEventObject(); ClickedButton = (wxButton *)event.GetEventObject();