-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
We should change the algorithm of deriving logical keys on Web, macOS, and Linus, so that they're more intuitive to use.
This aims to resolve the following problems:
- Shift-Digit keys are broken. For example, physical
Shift-Digit1produces logicalShiftLeft + exclamation. Related: - Digit keys are broken on French layout. For example, physical
Digit1produces logicalampersand. - Letter keys are broken on Russian layout. For example, physical
keyAproduces logicalф. Related:
Although it is still technically possible to define shortcuts for such scenarios, doing so requires platform- and language- dependent code, which is both unintuitive and cumbersome.
The goal can be demonstrated by the following table:
| When pressing physical keys... | on layout | Previous logical keys | New logical keys |
|---|---|---|---|
| 1 | US | digit1 |
digit1 (unchanged) |
| Shift-1 | US | shiftLeft + exclamation |
shiftLeft + digit1 |
| 1 | French | ampersand |
digit1 |
| Shift-1 | French | shiftLeft + digit1 |
shiftLeft + digit1 (unchanged) |
| a | Russian | ф |
keyA |
This is specially critical to non-latin layout users (such as Cyrillic letters) because their keyboard currently can not use any shortcuts, including Ctrl-C, Ctrl-V, Ctrl-A, etc.
You might ask: Then how do I know that Shift-1 is an exclamation mark? Fear not. You can still get it from {Raw,}KeyEvent.character. However, this means you can not define shortcuts for Shift-exclamation or simply exclamation for US layout anymore. This might be resolved by adding another field to {Raw,}KeyEvent, but I'm still unsure whether to do so.
Progress
- Windows: doesn't need it.
- macOS
- Linux/GTK
- Web
- iOS
- Android: doesn't need it