-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Make keyboard layouts in charge of modifier keys and formatting of keys #257
base: main
Are you sure you want to change the base?
Commits on Oct 31, 2021
-
Revert "Add arrow glyphs jupyterlab#151"
This reverts commit 57a6ee7. It was not clear in issue jupyterlab#151 calling for a change in formatting of arrows that arrows should not be treated as modifier keys.
Configuration menu - View commit details
-
Copy full SHA for c093829 - Browse repository at this point
Copy the full SHA c093829View commit details
Commits on Nov 2, 2021
-
Format a key for display in the keyboard layout.
This puts the formatting of human-readable strings closer to where the keys are actually defined, and allows new keyboard layouts to extend this formatting for other keys the keyboard may have. This is exploratory work. It seems that the formatting of specific keys is not standardized across applications, operating systems, or keyboards, so I’m not sure if this will make anyone happier. It does seem like the keyboard layout is the right place for this formatting logic to happen for individual keys in the layout. I did verify that VoiceOver reads each of the macOS shortcuts correctly in menus (e.g., the curvy right arrow is read as “return” in a menu, etc.)
Configuration menu - View commit details
-
Copy full SHA for 0371ee5 - Browse repository at this point
Copy the full SHA 0371ee5View commit details -
More work on using modifier keys from the layout instead of hardcodin…
…g them. This adds a modifierKeys attribute to the keyboard layout so we can iterate over the modifier keys. Since we often want to our modifier keys displayed in a specific order, we need the modifier keys to be an ordered set, but Object.keys ordering is not guaranteed until ES2020, I believe. Therefore I converted the modifier keys to a Set, which does iterate in insertion order for sure. Finally, we make a kind of awkward special case for Command/Meta treatment on macos so that things are backwards-compatible with the current behavior. There are some blockers to further progress using getModifierState to determine modifier keys: 1. It does not appear that we can easily clone a KeyboardEvent and clone the getModifierState function, at least not as easily as we did for the standardized ctrl, shift, alt, etc. A way forward is that we could keep a reference to the original event and proxy getModifierState calls to the original event. 2. The current keyboard layout specifies the control key as “Ctrl”, not the standardized “Control” used in getModifierState. This is so that users can specify their keyboard shortcuts using “Ctrl” instead of “Control”. To make more progress here, we could use “Control” in the keyboard layout, and carefully trace where “Ctrl” was used and convert it to “Control” at the appropriate places.
Configuration menu - View commit details
-
Copy full SHA for 5521525 - Browse repository at this point
Copy the full SHA 5521525View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03db23e - Browse repository at this point
Copy the full SHA 03db23eView commit details -
Change the Control modifier in the keyboard layout from Ctrl to Control.
We still keep the user-facing label as Ctrl for now for compatibility. This may be considered a breaking change in the keyboard package, since the layout has been changed to reference ‘Control’.
Configuration menu - View commit details
-
Copy full SHA for bfdf926 - Browse repository at this point
Copy the full SHA bfdf926View commit details -
Revert "Change the Control modifier in the keyboard layout from Ctrl …
…to Control." This reverts commit bfdf926.
Configuration menu - View commit details
-
Copy full SHA for f59ced4 - Browse repository at this point
Copy the full SHA f59ced4View commit details -
Convert Ctrl to Control when checking the modifier state.
This preserves backwards compatibility for the keyboard layout, while still switching to getModifierState for checking the modifier state.
Configuration menu - View commit details
-
Copy full SHA for a8bf225 - Browse repository at this point
Copy the full SHA a8bf225View commit details -
Configuration menu - View commit details
-
Copy full SHA for d15b22e - Browse repository at this point
Copy the full SHA d15b22eView commit details -
Configuration menu - View commit details
-
Copy full SHA for be5d3ff - Browse repository at this point
Copy the full SHA be5d3ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4acd80e - Browse repository at this point
Copy the full SHA 4acd80eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 34c3d92 - Browse repository at this point
Copy the full SHA 34c3d92View commit details