-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Format arrow shortcuts as arrow glyphs #151
Comments
Here are some lists of more glyphs for specific keys on a mac: https://apple.stackexchange.com/questions/55727/where-can-i-find-the-unicode-symbols-for-mac-functional-keys-command-shift-e |
Someone should check that the glyphs are accessible too :) |
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.
It looks like there has been some work on this (thanks!). It looks like conversation around this is now spread across #252, #255, and #256. To have a consolidated place for the conversation, I'm writing my thoughts here. I wasn't clear above that I meant to suggest that we just change the line at lumino/packages/commands/src/index.ts Line 1164 in 4f24322
Instead of always returning mods + parts.key , we should instead probably format parts.key if parts.key is something like ArrowUp , ArrowDown , etc. In other words, that line would be return mods + formattedKey where formattedKey would default to parts.key , but would be the unicode arrow right symbol if parts.key was ArrowUp , etc.
It looks like #252 instead pursued the approach of treating arrow keys as essentially modifiers, which caused some issues noted in #255, and further work in this direction was undertaken in #256. I propose we revert #252 and close #256 and instead just format Actually, if we wanted to make a more fundamental change, I think the mapping of a key name to a unicode string for display should happen in the Keyboard Layout code in the keyboards package. Only the keyboard layout really knows what keys are in the layout, and it should be the thing to tell how to display those keys in the interface. For example, what if a keyboard layout has an AltGr modifier, or doesn't have the Control modifier? Our hardcoded assumptions in |
We should also check with accessibility experts Vidar's good point above, that converting "ArrowUp" to "↑" may be a problem for screen readers. If displaying "↑" instead of "ArrowUp" is a problem for screen readers that we cannot fix, it may be better to just revert #252 and close this issue. |
I like the exploration in jasongrout@3c6b837, especially formatting space as a visible character, Long-term, another thing I would like for shortcuts is to have a utility to wrap the keys in Reverting works for me as well - no strong preference. If we choose to close my PR, let's remember to recycle the added unit test. |
Here is an old accessibility evaluation: https://www.deque.com/blog/dont-screen-readers-read-whats-screen-part-1-punctuation-typographic-symbols/ (2014). Some things are surprising (see "JAWS Bugs" section) which shows that we need to check on a character-by-character basis. The context matters too and some characters will be skipped in a sentence (say comma), but still, correctly read out loud in the context of a keyboard shortcut. At the time when the article was written in 2014 right/left arrows were read fine when standalone in two of the evaluated readers (NVDA, VoiceOver) but JAWS 15 was not up to the task. Up/down arrows only worked in VoiceOver. There is a subtle difference: they evaluated characters encoded as HTML entities, not Unicode. I would expect that today in 7 years from that the situation improved. |
NVDA and JAWS are windows-only, while this change I think is mac-specific (i.e., I think only MacOS actually shows the arrow glyph instead of printing the name, so we should probably be consistent), so hopefully we only have to worry about VoiceOver. |
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.
…rm conventions. Fixes jupyterlab#151
…rm conventions. Fixes jupyterlab#151
I've opened #257 to explore moving formatting and modifier keys logic over to keyboard layouts. It is a draft PR that I don't know if it is worth pursuing until we have (a) a usecase for other keyboard layouts with other modifiers or (b) can make breaking changes. I also opened #258 with the simpler approach mentioned above, and pulled in @krassowski's unit tests as well. I think we should review and merge #258. I think we should possibly close #257 as an experiment, and open it again later if someone wants to tackle the few other tricky issues with completing it. |
If a shortcut has an arrow key, right now the text (e.g., "ArrowRight") is printed when the shortcut is formatted for display in
lumino/packages/commands/src/index.ts
Lines 1133 to 1165 in 4f24322
A better convention, I think, is to replace arrows in the shortcut key with actual unicode arrow glyphs, i.e., "ArrowRight" with unicode 2192: →
The text was updated successfully, but these errors were encountered: