Merge pull request #6584 from Hinsbart/mod_release
x11: Fix event.is_action() for release of modifier keys
This commit is contained in:
commit
53c1c7ff8f
1 changed files with 13 additions and 0 deletions
|
@ -1176,6 +1176,19 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
|
|||
event.key.mod.shift=true;
|
||||
}
|
||||
|
||||
//don't set mod state if modifier keys are released by themselves
|
||||
//else event.is_action() will not work correctly here
|
||||
if (!event.key.pressed) {
|
||||
if (event.key.scancode == KEY_SHIFT)
|
||||
event.key.mod.shift = false;
|
||||
else if (event.key.scancode == KEY_CONTROL)
|
||||
event.key.mod.control = false;
|
||||
else if (event.key.scancode == KEY_ALT)
|
||||
event.key.mod.alt = false;
|
||||
else if (event.key.scancode == KEY_META)
|
||||
event.key.mod.meta = false;
|
||||
}
|
||||
|
||||
//printf("key: %x\n",event.key.scancode);
|
||||
input->parse_input_event( event);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue