boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.76k stars 433 forks source link

add_hotkey() and wait() stop working if laptop goes to sleep and then wakes up. #598

Open amolvenkataraman opened 1 year ago

amolvenkataraman commented 1 year ago

I have a program which uses keyboard.add_hotkey() and keyboard.wait() to listen for a specific hotkey (CTRL + Space in my case), and then run a function.

It works fine normally, but putting my laptop to sleep makes the hotkey listener stop, and it no longer does anything when I send the shortcut. The only way to get it to work again is to restart the entire program.

ErdemAkcali commented 1 year ago

keyboard.wait() also doesn't work for me after a long time has passed or after the computer wakes up from sleep.

hijam-git commented 5 months ago

I got same problem.