Check if WX recognized a key before testing if it's a hotkey

Fixes issue 5537.
This commit is contained in:
Pierre Bourdon 2012-08-05 17:28:57 +02:00
parent b3c9f437db
commit fe1501db9a
1 changed files with 3 additions and 2 deletions

View File

@ -797,8 +797,9 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event))
bool IsHotkey(wxKeyEvent &event, int Id)
{
return (event.GetKeyCode() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] &&
event.GetModifiers() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkeyModifier[Id]);
return (event.GetKeyCode() &&
event.GetKeyCode() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] &&
event.GetModifiers() == SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkeyModifier[Id]);
}
int GetCmdForHotkey(unsigned int key)