kmk_firmware icon indicating copy to clipboard operation
kmk_firmware copied to clipboard

Oneshot doesn't work with key taps sent on key release

Open electricWah opened this issue 2 years ago • 1 comments

The oneshot module holds down the given key until interrupted by another keypress, but it only releases when the other key releases, which is when holdtap and co send the tap key. As a result, the oneshot key is released just as the other key is being sent so modifiers do not get applied. The key is released on line 32: https://github.com/KMKfw/kmk_firmware/blob/a1d8a990f131dc0c2a30e601983b3730a4790dc7/kmk/modules/oneshot.py#L32 I think this could be resolved by moving the release into a timeout, or by force-sending the key buffer or hid report or whatever before the release, but I am still not entirely sure about how all the internals work so that is why this is an issue instead of a pull request.

This is reproducable by using KC.OS(KC.LSHIFT) and KC.HT(KC.A, KC.B). Tapping the oneshot key, then tapping the holdtap key produces a lowercase 'a', instead of 'A'.

electricWah avatar Jul 27 '22 03:07 electricWah

If you think you have a proposed solution, please open up a pull request with resolves #535 in the title and we'll take a look at that.

kdb424 avatar Aug 09 '22 22:08 kdb424