diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 666d26adc0..d8cf147586 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -278,7 +278,6 @@ extern int TranslateGDKtoWXK( u32 keysym ); void Pcsx2App::PadKeyDispatch( const keyEvent& ev ) { m_kevt.SetEventType( ( ev.evt == KEYPRESS ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ); - const bool isDown = (ev.evt == KEYPRESS); //returns 0 for normal keys and a WXK_* value for special keys #ifdef __WXMSW__ @@ -291,14 +290,12 @@ void Pcsx2App::PadKeyDispatch( const keyEvent& ev ) # error Unsupported Target Platform. #endif - switch (vkey) - { - case WXK_SHIFT: m_kevt.m_shiftDown = isDown; return; - case WXK_CONTROL: m_kevt.m_controlDown = isDown; return; - - case WXK_ALT: // ALT/MENU are usually the same key? I'm confused. - case WXK_MENU: m_kevt.m_altDown = isDown; return; - } + // Don't rely on current event handling to get the state of those specials keys. + // Typical linux bug: hit ctrl-alt key to switch the desktop. Key will be released + // outside of the window so the app isn't aware of the current key state. + m_kevt.m_shiftDown = wxGetKeyState(WXK_SHIFT); + m_kevt.m_controlDown = wxGetKeyState(WXK_CONTROL); + m_kevt.m_altDown = wxGetKeyState(WXK_MENU) || wxGetKeyState(WXK_ALT); m_kevt.m_keyCode = vkey? vkey : ev.key;