mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
keyboard: remove exceptions from storing pressed keys
These exceptions were added to prevent certain keys (modifiers and synthetic layout switch key-events) from disabling keybindings (due to the "nr_pressed_keys > 1" check). That check no longer exists, so the exceptions should no longer be necessary. Partially revertse77330bc3fand3e2baa3f05.
This commit is contained in:
parent
5a77a3ad51
commit
fe9491443c
1 changed files with 2 additions and 13 deletions
|
|
@ -230,25 +230,14 @@ handle_compositor_keybindings(struct keyboard *keyboard,
|
|||
*/
|
||||
|
||||
bool is_modifier = false;
|
||||
bool is_layout_switch = false;
|
||||
uint32_t modifiers = wlr_keyboard_get_modifiers(wlr_keyboard);
|
||||
|
||||
for (int i = 0; i < translated.nr_syms; i++) {
|
||||
is_modifier |= is_modifier_key(translated.syms[i]);
|
||||
is_layout_switch |= translated.syms[i] == XKB_KEY_ISO_Next_Group;
|
||||
}
|
||||
|
||||
/*
|
||||
* An earlier press event from a key that causes a layout change event
|
||||
* might have been added already without us knowing that it actually was
|
||||
* a XKB_KEY_ISO_Next_Group sym. Thus we always try to remove the current
|
||||
* key from the set of pressed keys on release.
|
||||
*/
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||
key_state_set_pressed(event->keycode, false);
|
||||
} else if (!is_modifier && !is_layout_switch) {
|
||||
key_state_set_pressed(event->keycode, true);
|
||||
}
|
||||
key_state_set_pressed(event->keycode,
|
||||
event->state == WL_KEYBOARD_KEY_STATE_PRESSED);
|
||||
|
||||
if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue