Description
When on_activate func is blocked and takes more than 2 seconds,the hotkeys will not release successfully.
Next time you press the hotkeys will release them only, and the on_activate func will not be activated as expected.
Platform and pynput version
win10 22h2
python 3.10.6
pynput 1.7.6
To Reproduce
import time
from pynput import keyboard as kb
def hk_unrelease_bug():
def on_active_e():
sys.exit(0)
def foo():
print("I'm sleeping")
time.sleep(3)
print("awake")
with kb.GlobalHotKeys({
'<ctrl>+e': on_active_e,
'q+w+e': foo
}) as hk:
hk.join()
hk_unrelease_bug()
Description When
on_activate
func is blocked and takes more than 2 seconds,the hotkeys will not release successfully. Next time you press the hotkeys will release them only, and theon_activate
func will not be activated as expected.Platform and pynput version win10 22h2 python 3.10.6 pynput 1.7.6
To Reproduce