erjiang / huion-keys

Linux program to create custom bindings for Huion tablet hotkeys
GNU General Public License v3.0
13 stars 4 forks source link

Threaded input implementation #12

Closed NeoTheFox closed 3 years ago

NeoTheFox commented 3 years ago

I started rewriting the main part of the script to be threadable because threading the input polling is a good way of solving #11

At first, I thought that the solution to this issue would be to just get better hidraw device detection, but the truth is - there are multiple input devices, and we don't know which one would be the one to give button input. For all we know - some devices may report some events through one device and others through another. A better idea would be to just read them all. This also gives us multiple device support on top of that.

DO NOT MERGE THIS YET, because I can't get the xdo module to work in a thread. Any help would be greatly appreciated, I think I've reached the limit to my python threading knowledge here.

NeoTheFox commented 3 years ago

Ok, I got it working, there was nothing wrong with the threading code, I just messed up the indent during refactoring. This works without any issues on my machine and exits cleanly now. Ready to merge.

erjiang commented 3 years ago

Sorry, forgot that this PR was still open. I've been using it for the last couple months and haven't had any issues.