Linux: Don't keep Alt flag pressed when we Alt+tab the window

This commit is contained in:
David Capello 2017-11-29 18:07:36 -03:00
parent 5e7cc50cb0
commit 677d5253ad
2 changed files with 4 additions and 1 deletions

View File

@ -2353,6 +2353,9 @@ static void _xwin_private_process_event(XEvent *event)
case FocusOut:
_switch_out();
_xwin_keyboard_focus_handler(&event->xfocus);
/* Remove Alt key flag (so if we switch to another window
with Alt+tab the Alt flag isn't kept pressed) */
_key_shifts &= ~KB_ALT_FLAG;
break;
case ButtonPress:
/* Mouse button pressed. */

View File

@ -204,7 +204,7 @@ public:
bool isKeyPressed(KeyScancode scancode) override {
#ifdef ALLEGRO_UNIX
if ((scancode == kKeyAlt) &&
(key_shifts & KB_ALT_FLAG)) {
(_key_shifts & KB_ALT_FLAG)) {
return true;
}
#endif