diff options
author | nerdopolis <bluescreen_avenger@verizon.net> | 2023-12-04 17:41:26 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2023-12-04 18:37:06 -0500 |
commit | 4ee7056ff824496af2b8cf7be24f89a66c3e5b4b (patch) | |
tree | 7ac6d19791dc7d347dd3c8205d88cc17947f1b42 | |
parent | 6b5bd35a0e353259b318ab5c675569f98644cc22 (diff) |
ply-input-device: Handle modifiers better
At the moment, holding down the shift key sends
key repeat events that lead to the output not
getting properly shifted.
This commit avoids updating modifier state when
the modifer key is held down.
-rw-r--r-- | src/libply-splash-core/ply-input-device.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libply-splash-core/ply-input-device.c b/src/libply-splash-core/ply-input-device.c index db826ab9..02506090 100644 --- a/src/libply-splash-core/ply-input-device.c +++ b/src/libply-splash-core/ply-input-device.c @@ -237,12 +237,14 @@ on_input (ply_input_device_t *input_device) symbol = xkb_state_key_get_one_sym (input_device->keyboard_state, keycode); - updated_state = xkb_state_update_key (input_device->keyboard_state, keycode, xkb_key_direction); - - if ((updated_state & XKB_STATE_LEDS) != 0) { - ply_trace ("Keyboard indicator lights need update"); - input_device->leds_state_invalid = true; - ply_trigger_pull (input_device->leds_changed_trigger, input_device); + if (key_state != PLY_KEY_HELD) { + updated_state = xkb_state_update_key (input_device->keyboard_state, keycode, xkb_key_direction); + + if ((updated_state & XKB_STATE_LEDS) != 0) { + ply_trace ("Keyboard indicator lights need update"); + input_device->leds_state_invalid = true; + ply_trigger_pull (input_device->leds_changed_trigger, input_device); + } } /* If the key is repeating, or is being pressed down */ |