finkrer / KeyboardChatteringFix-Linux

A tool for blocking mechanical keyboard chattering on Linux
MIT License
107 stars 15 forks source link

python3 process runs on full CPU capacity when keyboard disconnected #1

Open michal7918 opened 3 years ago

michal7918 commented 3 years ago

Thank you for useful script! It fixed chattering problem with my Rapoo E9260 keyboard and works better than other solutions suggested elsewhere.

Unfortunately since I run it on notebook with docking station, I frequently undock my notebook and then problem starts. In most cases (not every time), soon after the dock and keyboard is disconnected, the python3 process starts consuming full CPU thread capacity, leading to ventilator running in full speed until the process is terminated. It happens both in case running script from service or command line.

I hope you can fix this issue.

finkrer commented 3 years ago

Hi Michal. Thanks for reporting the issue.

The code is very simple, so it's obvious what's wrong. I just need to figure out how to prevent that. I don't use the script anymore as I have a new keyboard, but I will try to find time to work on this in the coming days.

michal7918 commented 3 years ago

Thank you. I'm not familiar with python but I assume that basic problem is that scripts assume that device is always connected. I hope you can figure out solition to this issue. Thank you so much for looking at that. Cheers.

CarlosRuiz-globalqss commented 2 months ago

I just tried running this as a system service.

When the keyboard is disconnected the service is stopped, and when the keyboard is connected again the service is started automatically.

So, working like a charm as a service.