-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Move away from KeyboardEvent.key for key bindings? #146
Comments
We saw similar browser inconsistency issues in Lumino (at least a few years ago, when shortcuts were being developed), and decided to go with |
Here is our unified keycode table for US keyboard layout for various browers, FYI. |
I just reproduced this on Firefox 71 on macOS 10.14.6. For example, using https://keycode.info/ and using
|
See also this spec issue, which doesn't appear to be going anywhere, and this webkit issue where people are, predictably, saying the spec should adjust to what Apple is doing, rather than the other way around. |
I've decided against this—even though it doesn't look like this'll be fixed anytime soon, the situation with My position, then, is to treat this as a kludgey implementation that tries to approach a simple key binding system as closely as it can, but is known to be broken in corner cases due to platform limitations. |
(On the bright side, since the keymap module just another extension, there's always space for implementing a custom approach when you really need it.) |
Its value isn't specified precisely enough for key combinations involving shift plus other modifiers (some browsers consider such combinations to produce characters, and include the effect of shift, others don't, so Shift-Ctrl-X may yield
"x"
or"X"
).It may be better to go back to using
keyCode
, which at least reliably identifies the key. That removes support for by-printable-character bindings, but the endless string of issuesKeyboardEvent.key
has caused in ProseMirror suggests that that may be a reasonable price to pay.(Possibly we could allow by-printable-character bindings only for bindings without modifiers. But I'm not sure how useful that would be.)
The text was updated successfully, but these errors were encountered: