KMKfw / kmk_firmware

Clackety Keyboards Powered by Python
https://kmkfw.zulipchat.com
Other
1.32k stars 458 forks source link

Refactor sticky/oneshot keys #978

Closed xs5871 closed 1 week ago

xs5871 commented 3 weeks ago

There was a thing that didn't work for me, and once again... as I came to realize, the current implementation based on modified hold-tap mechanism wasn't the best choice in the first place and increasingly difficult to work around.

The old oneshot module is still in place, can be cleaned up eventually.

regicidalplutophage commented 3 weeks ago

Oneshot name is a staple when discussing small keymaps. I don't mind the module being called sticky keys, but can you make it clear the sticky keys are the same as oneshot?

I'm a heavy oneshot user with the implementation almost the same as Callum, so I'm going to test it before approving. One feature I'd like is if a sticky keycode is being held for some time, it starts being treated as a normal keycode that's being held. Current implementation didn't mix well with holdtap, so going to test that too. The reason is modifier+mouse inputs are common in CAD packages and mouse being a different device has no effect on sticky/oneshot keys.

xs5871 commented 3 weeks ago

Here's my argument: The term "one shot mod" is QMK specific as far as I can tell, the term "sticky keys" has been around since the late 80's and is used pretty much everywhere, except QMK. If you're not already familiar with QMK and its tendency for whacky names "oneshot" sounds like a key that can only be used once, and that'd be silly. I conjecture that "sticky key" will more readily convey the functionality to the uninitiated.

Mentioning the alternative name is a good idea. We've also been misspelling "one shot".

All of the problems of the old one shot implementation you mentioned should be fixed and verified by unit tests. There were too many corner cases where they didn't quite do what one would expect.