Close tab (ctrl+W) shortcut uses character instead of virtual key (Window's)
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: L0laapk3, Unassigned)
References
Details
(Whiteboard: [key hell])
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0
Steps to reproduce:
First some necessary terminology to establish a common baseline: there are 3 types of key identifiers in windows. I will refer to them by the naming as used in Microsoft Keyboard Layout Creator (MSKLC).
- Scancode (JS:
KeyboardEvent.code): Represents the physical key location. Does not change with keyboard layout setting. (Often used in games for WASD controls or similar keybindings that should be the same position regardless of keyboard layout. Not relevant for this Bug report) - Virtual key (JS: kind of like
KeyboardEvent.keyCode): Represents the equivalent QWERTY scancode of the key. For example, pressing 'W' on an AZERTY keyboard will return the same Virtual key as pressing 'W' on a QWERTY keyboard. (To be used for most shortcuts) - Character map (JS:
KeyboardEvent.key): The actual character that is to be typed. To be used for text inputs.
I use a custom keyboard layout in windows; The characters are defined in a dvorak layout while the virtual keys match azerty such that default shortcuts are still in the same sensible positions that I grew used to. The layout can be found here: https://github.com/L0laapk3/dvazerty/blob/master/dvazerty.klc .
This works in almost all programs. Firefox is no exception and almost all keyboard shortcuts appear to use Virtual keys and work as expected. However there is one notable exception: CTRL+W to close the tab. This specific keybinding appears to use the character map for some reason.
Actual results:
Using the windows keyboard layout from https://github.com/L0laapk3/dvazerty:
I press CTRL+[W key] (KeyboardEvent{code = "KeyZ", key="'"}). Quick find opens.
I press CTRL+[; key] (KeyboardEvent{code = "Comma", key="w"}). Tab closes.
Expected results:
I press CTRL+[W key] (KeyboardEvent{code = "KeyZ", keyCode=87, key="'"}). Tab closes.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
I know this issue, but this is reproducible only with some custom keyboard layouts including ones created by MSKLC. On the other hand, changing this behavior requires big changes and is too risky because we need to test a lot of things for a lot of keyboard layouts. Therefore, nobody can work on this as an employee, but I don't say nobody do that especially for volunteers.
Updated•2 years ago
|
Description
•