-
-
Notifications
You must be signed in to change notification settings - Fork 39.1k
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
Keyboard: Add sticky keys functionality #3939
Conversation
Adding an option to reproduce sticky keys accessibility feature [https://en.wikipedia.org/wiki/Sticky_keys] Tapping modifier keys in any sequence will add them to a register and apply them all with a keycode when next non-modifier keycode is sent through. A second tap to a modifier will lock it, such that even after the keycode is sent with applied modifiers, locked modifiers will remain on the register. Tapping shift five times toggles the feature on and off.
One Shot Mods does this already, I think: https://docs.qmk.fm/#/feature_advanced_keycodes?id=one-shot-keys |
It's not possible to achieve this functionality with one shot mods, as far as I know. Mods clear after the post-mod key press. Additionally, there is a time limit as to how long after the mod is tapped that the feature applies. No such restrictions apply here. Users can take as long as they need and apply up to all four mods. It's like a super mod one-shot. This is a standard accessibility feature that typically has needed OS software to enable. I thought being able to carry it on your own keyboard would be really useful. |
For OSM, mods only clear if And if you hit another mod key, it will stack them, as well. It's just that the functionality here is very similar, and I want to make sure that we're not adding another feature that heavily overlaps here. |
ANd I'm starting to see what you're trying to do here. 👍 |
@drashna I didn't know that about the I tried it just now by placing the following keys on a clean keyboard:
The sticky mods behaviour seems OK, though there might a slight bug. Some mods do lock if you mash around the mods and then hit another key. I'm not sure how to reproduce this consistently yet, but it does happen. |
Yeah, I think you can see my concern about overlapping features. However, this does look distinct enough to me, that and it's definitely very neat. :) |
For the OSM bug I mentioned just now, I'm wondering if it's related to the issue I raised previously: #3838 It certainly seems to be a similar behaviour, a layer/mod getting stuck when I piano over two OSL/OSM keys at the same time. The OSM one seems more difficult to reproduce, but it happens often enough that it seems a real issue. I think I may re-open that issue and even look in to it. |
I think I can close this PR. It seems you can achieve a very similar functionality just by putting this in a keymap's
It works pretty darn well. If I was 80% towards sticky keys functionality with my previous attempt at using OSM only, I'd say i'm up to 98% now. I suspect there's still a subtle bug here somewhere. Mashing around on modifiers again I got in to a state where a modifier got stuck, with seemingly no way to clear it. I'll file an issue if I can reliably recreate it. Some things are slightly different than how macOS implements sticky keys (can't talk about other OS, haven't really tried sticky keys on them), whereby tapping twice on a mod, no matter the the mod sequence, will toggle it. So In contrast the setup with I'm glad there's a way of achieving this functionality without expanding the core. I wonder though whether there need exist a place for 'recipes' like this. There's a lot of cool functionality that people are creating with this firmware, but you have do dig through the keymaps in source to find them. |
Adding an option to reproduce sticky keys accessibility feature [https://en.wikipedia.org/wiki/Sticky_keys]
Tapping modifier keys in any sequence will add them to a register and apply them all with a keycode when next non-modifier keycode is sent through.
A second tap to a modifier will lock it, such that even after the keycode is sent with applied modifiers, locked modifiers will remain on the register.
Tapping shift five times toggles the feature on and off.