]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-input-device: Handle modifiers better
authornerdopolis <bluescreen_avenger@verizon.net>
Mon, 4 Dec 2023 22:41:26 +0000 (17:41 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 4 Dec 2023 23:37:06 +0000 (18:37 -0500)
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.

src/libply-splash-core/ply-input-device.c

index db826ab9a2ff8ef430086eae17dfa5695fa5dcd9..0250609080e54a148cee44717e25e577404cad60 100644 (file)
@@ -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 */