Skip to content

Commit

Permalink
Add delay to fix incorrect capturing of LEFTSHIFT key presses
Browse files Browse the repository at this point in the history
See GitHub issue for more details:
gvalkov/python-evdev#209
  • Loading branch information
mroavi committed Sep 6, 2024
1 parent 1284b16 commit 831cdad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onthefly/onthefly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 831cdad

Please sign in to comment.