Like many of you, I’ve wrestled with the tap-hold dilemma: set a short TAPPING_TERM
for quick holds at the cost of accidental activations, or lengthen it for more reliable tapping, which can make holds feel sluggish. While there are many clever settings to tweak, I often felt I had to significantly adapt my typing style to the algorithm, rather than the algorithm to me.
To explore a different approach, I’d like to share a QMK community module I’ve been working on called Predictive Tap-Hold (PTH). To predict whether a tap or a hold was intended, PTH analyzes event sequences, timing between presses, and which hand is used. For ambiguous cases, it relies on generated decision trees and evolved functions.
With the training dataset, these functions reached about 96% accuracy in distinguishing taps from holds. With another dataset, they still performed similarly. While that number might not sound ideal, it’s important to know that the dataset included a wide variety of typing styles and required a lot of filtering (77,614 of 168,593 participant datasets were used). While better data will lead to future improvements, no prediction is flawless, and there will likely always be an adjustment period.
PTH is also highly configurable, which I hope makes it easy to handle edge cases and match your personal typing style. For instance, an Instant Hold feature allows the hold function (even LT
) to activate the moment you press the key, which is useful for things like holding LCTL_T
and using the scroll wheel to zoom without any delay.
The module is designed with ergonomics in mind. By default, when a key like RSFT_T(KC_H)
from the right side is pressed, it will only choose hold if the next keypress comes from the other side and no third key is pressed. This can help prevent same-hand fatigue and make taps more reliable.
I’ve also aimed to make PTH compatible with other great QMK features like Combos and Tap Dance.
My hope is that this module might help make powerful setups like home-row mods feel more accessible and intuitive. It’s now available as a QMK Community Module if you’re willing to experiment. Thank you for checking it out, and I would genuinely appreciate any feedback you might have. If you run into any problems, I’d love a message or a report in the repository.
Thank you, crossposting to ! [email protected] for wider reach
Thanks for crossposting this! 👍