-
Notifications
You must be signed in to change notification settings - Fork 125
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
Actions: Break latch on modifier/group changes #51
base: master
Are you sure you want to change the base?
Conversation
I am very unfamiliar with latching but I have a question. Let's say I configured LSHIFT and LCTRL to produce latching Shift and Control modifiers (e.g. like StickyKeys but configured directly in the keymap). If I want to type Shift+Control+Z, the key sequence I would expect to type is (correct me if I'm wrong)
If I understand the patch correctly, it will break that, since the |
Ugh, yes, I'd not really thought of that. Frustrating. I think the only other option I can see is to expand the syntax to allow Set/Latch/LockMods() actions to be able to clear other mods at the same time. |
I am trying to understand the problem. Can you provide the keymap configuration that causes the sequence you specified to occur? I think maybe you mean something like the following?
But then the first part of the key sequence is already confusing to me. If shift latches, why is it About the second part of the sequence, is the problem that because both |
Right now, only a few actions result in breaking a key latch. Add modifier/group actions to this, as presumably the effect of the latch should not last beyond already shifting the modifier/group state. This was discovered with a real-world use in an input device for the physically impaired, where shift latches, but pressing shift twice goes to caps lock (note shift vs. caps lock, so not pure latch-to-lock). This is possible to implement with current keymap files, but locking caps lock would not break the shift latch. Hence, the following key sequence: [Shift] [a -> a] [Shift] [Shift] [b -> b] [c -> C] would occur, as the modifier state when pressing b was lock locked and shift latched. With this patch, the sequence is correct: [Shift] [a -> a] [Shift] [Shift -> Lock] [b -> B] [c -> C] Signed-off-by: Daniel Stone <[email protected]>
Yes, sorry. I was thinking when I was walking home that I should've included a testcase, but thought I could get away with it until tomorrow at least. ;) Anyway, I've updated the commit to include one now. You're right with everything: in what I'm after (shift once to |
@bluetech Any thoughts? AFAICS, it's either this, or make new syntax:
|
Right now, only a few actions result in breaking a key latch. Add modifier/group actions to this, as presumably the effect of the latch should not last beyond already shifting the modifier/group state.
This was discovered with a real-world use in an input device for the physically impaired, where shift latches, but pressing shift twice goes to caps lock (note shift vs. caps lock, so not pure latch-to-lock). This is possible to implement with current keymap files, but locking caps lock would not break the shift latch. Hence, the following key sequence:
[Shift] [a -> A] [Shift] [Shift -> Lock] [b -> b] [c -> C]
would occur, as the modifier state when pressing b was lock locked and shift latched. With this patch, the sequence is correct:
[Shift] [a -> A] [Shift] [Shift -> Lock] [b -> B] [c -> C]