-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dedupe modifiers API #4254
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
Open
eugenesvk
wants to merge
62
commits into
rust-windowing:master
Choose a base branch
from
eugenesvk:fr-mod-dedupe
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
Dedupe modifiers API #4254
Conversation
This file contains hidden or 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
the new Modifiers can express Caps Lock
shift, alt, meta, control
only consider common shortcut-related mods, ignore numlocks etc
including alternate `:#` notation to print modifiers in a "fixed" position within an all-mod string
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.
Removes the confusing and inconsistent state vs pressed keys for modifiers and consolidates all into a single struct. See a more detailed overview of the suggestions #4236
Also implemented
Displayforwinit_core::keyboard::Modifiersto print ‹⇧⎇ modifier combos, including an:#alternate notation to preserve modifier symbol positioning (for vertically-aligned formatting).Also added a
Primaryconvenience modifier alias to Ctrl on PC/Linux and Cmd on Mac since these serve the same functionality of "primary control", e.g., Cmd+O to open a file and Ctrl+O to do the same; to simplify setting up x-platform keybindsIt's based on top of all other modifier-related changes (#4244 + #4251 doc updates), so looks bigger as a standalone PR
Open questions:
To make setting existing keybinds easier in the same side-agnostic way, I've added an extra duplicated common mods like
Shiftin addition to Left/Right, but there was a concern about the extra bits Add location awarness toModifiersChangedevent on Windows #3611 (comment), so not sure whether it's worth it. If it's kept, then the bitflag values should be in triplets (would also maintain old values even though the types would change)?I'm also not completely clear on Winit's treating of AltGraph and whether due to the fact that Mac's Alts behave like AltGraphs Winit should have Left/Right AltGraphs as well to reflect this (on Windows you can only have one artifical AltGraph, so you'd also only have 1 modifier). Add *Locks as a separate modifiers #4244 (comment)
±Only Windows+Mac tested. Tested on all platforms changed
Added an entry to the
changelogmodule if knowledge of this change could be valuable to usersUpdated documentation to reflect any user-facing changes, including notes of platform-specific behavior
Application(fixed modifier matching bug) andkbd_ev_printexamples Created or updated an example program if it would help users understand this functionalityCloses #4236