-
Notifications
You must be signed in to change notification settings - Fork 124
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
Various fixes and improvements to latching behavior #569
Open
Jules-Bertholet
wants to merge
5
commits into
xkbcommon:master
Choose a base branch
from
Jules-Bertholet:locks-break-latches
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Various fixes and improvements to latching behavior #569
Jules-Bertholet
wants to merge
5
commits into
xkbcommon:master
from
Jules-Bertholet:locks-break-latches
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For example, if `Caps_Lock` is on the second level of some key, and `Shift` is latched, pressing the key will lock `Caps` while also breaking the `Shift` latch, ensuring that the next character is properly uppercase. (Prior to this commit, both `Shift` and `Caps` would be active, so the next character would be lowercase.) Signed-off-by: Jules Bertholet <[email protected]>
Jules-Bertholet
changed the title
Make any lock break all latches, and group latches break mod latches
Make all locks break all latches, and group latches break mod latches
Dec 21, 2024
Jules-Bertholet
force-pushed
the
locks-break-latches
branch
from
December 21, 2024 21:27
d48426c
to
7c82bb5
Compare
Jules-Bertholet
changed the title
Make all locks break all latches, and group latches break mod latches
Make new locks break all latches, and new latches break some latches
Dec 21, 2024
Jules-Bertholet
force-pushed
the
locks-break-latches
branch
from
December 21, 2024 21:31
7c82bb5
to
801c873
Compare
Jules-Bertholet
force-pushed
the
locks-break-latches
branch
3 times, most recently
from
December 21, 2024 21:37
0e7cb15
to
03ef230
Compare
Changed latching behavior so that latching a modifier or group now breaks existing modifier latches, but only if the type of the key responsible for the latter latch has the modifier of the pre-existing latch in its modifiers list. For example, if a new latch is triggered by pressing a key of type `ALPHABETIC`, existing `Shift` and `Lock` latches will now be broken, but other latches will be preserved as before. This ensures the correct behavior when combining sticky keys with `ISO_Level5_Latch` or latched-group additional symbols layers. Signed-off-by: Jules Bertholet <[email protected]>
Jules-Bertholet
force-pushed
the
locks-break-latches
branch
from
December 21, 2024 21:38
03ef230
to
cf08189
Compare
Prior to this commit, "latch A down" → "latch B down" → "latch A up" → "latch B up" would result in only B being latched. After this commit, both A and B end up latched. Signed-off-by: Jules Bertholet <[email protected]>
Jules-Bertholet
changed the title
Make new locks break all latches, and new latches break some latches
Various fixes and improvements to latching behavior
Dec 22, 2024
Signed-off-by: Jules Bertholet <[email protected]>
Signed-off-by: Jules Bertholet <[email protected]>
Jules-Bertholet
force-pushed
the
locks-break-latches
branch
from
December 23, 2024 17:10
dc4277e
to
eac392e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Any new lock breaks all existing latches
For example, if
Caps_Lock
is on the second level of some key, andShift
is latched, pressing the key will enableCaps
while also breaking theShift
latch, ensuring that the next character is properly uppercase. (Prior to this commit, bothShift
andCaps
would be active, so the next character would be lowercase.) (Setting a lock vialatchToLock
or clearing it viaclearLocks
also breaks all latches.)New latches break existing latches for non-
preserve
d modifiers in the modifier list of the type of the key that triggered the new latchFor example, if a new latch is triggered by pressing a key of type
ALPHABETIC
, existingShift
andLock
latches will now be broken, but other latches will be preserved as before.This ensures the correct behavior when combining sticky keys with
ISO_Level5_Latch
or latched-group additional symbols layers.The rules for what does and does not break a latch are also applied before the latch is formed
Notably, pressing two latching keys simultaneously now applies both latches. For example, if I set up sticky keys, and then press
Shift
andAltGr
together, both modifiers now end up latched.An alternative to #51 that resolves its motivating issue without incurring the problems discussed in the comments there.