Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable defining per-key thresholds #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mkrizmancic
Copy link

Hi @CarlosRuiz-globalqss,

Firstly, thank you very much for this repository. It's a lifesaver for dealing with my chatty keyboard!

I have a specific situation where only some keys on my keyboard chatter (a lot, sometimes more than 150 ms between two key presses). As I am a relatively fast typer compared to that delay, setting a high global threshold slows me down and is quite annoying. On Windows, I use Keyboard Chatter Blocker which has a nice GUI for setting individual thresholds for each key, so I decided to implement something similar.

There is no GUI, but I added a YAML config where you can specify a threshold for each key. The only change needed in the code was really to replace the int threshold with a dict.

By default, the program works as before. If the config file is not found, it uses the default threshold value (30 ms) or the one provided on the command line. If there is a config file, it will apply the thresholds for each specified key. Commented keys are ignored and use the default threshold specified in the file. I was struggling to find out the names of the keys, so I also added a function that can (optionally) create a template config file with the names of the available keys on a given keyboard. The usage is explained in the README.

@CarlosRuiz-globalqss
Copy link

CarlosRuiz-globalqss commented Feb 5, 2025

Hi @mkrizmancic

I need to clarify first this is not my repository, big kudos are for @finkrer who shared this!

This pull request sounds really useful, thanks for that.

@mkrizmancic
Copy link
Author

Oops 😅
Yes, I am aware of this. I was browsing forks to see if somebody already did this and I guess I stopped at yours and accidentally copied your username instead of @finkrer who absolutely deserves kudos for this repo 🚀
Sorry about the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants