From 831cdad01e9b9c93893a5f38030e54b1b097fdf3 Mon Sep 17 00:00:00 2001 From: Martin Roa Villescas Date: Fri, 6 Sep 2024 14:22:30 +0200 Subject: [PATCH] Add delay to fix incorrect capturing of LEFTSHIFT key presses See GitHub issue for more details: https://github.com/gvalkov/python-evdev/issues/209 --- onthefly/onthefly.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onthefly/onthefly.py b/onthefly/onthefly.py index a69938d..3ea1612 100644 --- a/onthefly/onthefly.py +++ b/onthefly/onthefly.py @@ -66,14 +66,17 @@ def read_config_keyboard_device_path(filepath): def simulate_key(ui, code, keystate): ui.write(ecodes.EV_KEY, code, keystate) + time.sleep(0.005) # TEMP: fixes bug (see: https://github.com/gvalkov/python-evdev/issues/209) ui.syn() def simulate_key_press(ui, code): ui.write(ecodes.EV_KEY, code, 1) + time.sleep(0.005) # TEMP: fixes bug (see: https://github.com/gvalkov/python-evdev/issues/209) ui.syn() def simulate_key_release(ui, code): ui.write(ecodes.EV_KEY, code, 0) + time.sleep(0.005) # TEMP: fixes bug (see: https://github.com/gvalkov/python-evdev/issues/209) ui.syn() def simulate_key_stroke(ui, code):