gmamaladze / globalmousekeyhook

This library allows you to tap keyboard and mouse, detect and record their activity even when an application is inactive and runs in background.
MIT License
1.04k stars 257 forks source link

Listening key events are preventing system from going to sleep #190

Open guzelonur opened 2 months ago

guzelonur commented 2 months ago

Hi,

I don't know if there is anyone experiencing the issue, if I reference this library and run some piece of demo code after compilation, Windows ignores timeout values about power saving that defined in various power schemes such as "turn off display after xxx minutes" or "go standby after xxx minutes" and the system never goes to sleep or turns off the display as long as the demo program is running.

If I close the program (the program has reference to this library), everything goes back to normal. I experienced that on an old XP SP3 machine which lacks parameterized usage of "powercfg /requests" that would reveal the program (the program that is breaking the system idling sequence) on higher versions of Windows if you try with the same powercfg command (with /requests switch).

I would like to get feedback if anyone else is experiencing the identical problem.

Best regards.