Incorrect keyname when using Portuguese keyboard in Safari #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There appears to be a bug in the keyname calculation when using a Portuguese keyboard layout in Safari. I'm also aware that Swedish keyboard layouts are affected (and possibly others), but haven't tested as extensively.
Specifically, pressing
Shift-7returns?when it should return/. I've put together this minimal reproduction to demonstrate the issue. Here's some screenshots from a colleague with a Portuguese keyboard:Safari
Chrome
Firefox
I can also reproduce by switching my keyboard input source to Portuguese on macOS.
For context, we have added a
Meta-Shift-7keybinding in CodeMirror 6, to account for the default toggle comment shortcut (Meta-/) not working on Portuguese keyboards across all browsers. I believe this is because/is onShift-7on Portuguese (and similar) keyboard layouts.What are the values of
event.keyandevent.keyCodewhen this happens?Here's the "event dump" from keycode.info when using Safari:
And here's the same when using Chrome & Firefox for reference:
Looks like the logic to correct for inaccurate
keyproperties was kicking in too aggressively here. Patchgithub.com/marijnh/w3c-keyname@600aae45ecshould help.Thanks! Looks like that's fixed now:
I'll close this out now.