diff --git a/openwhispr-ptt.py b/openwhispr-ptt.py index c9423ca..0c25d64 100644 --- a/openwhispr-ptt.py +++ b/openwhispr-ptt.py @@ -60,9 +60,13 @@ def send_whispr_toggle(): def find_keyboard(): - """Find the keyboard device.""" + """Find the real physical keyboard device (not virtual devices).""" devices = [evdev.InputDevice(path) for path in evdev.list_devices()] for dev in devices: + # Skip virtual devices (ydotool, xdotool, etc.) + name_lower = dev.name.lower() + if "virtual" in name_lower or "ydotool" in name_lower: + continue caps = dev.capabilities(verbose=False) if ecodes.EV_KEY in caps: keys = caps[ecodes.EV_KEY]