Skip to content

[Keyboard] Analyze keyboard layout and enforce mandatory logical keys #100456

@dkwingsmt

Description

@dkwingsmt

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:

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsfyi-linuxFor the attention of the Linux platform teamfyi-windowsFor the attention of the Windows platform teamplatform-linuxBuilding on or for Linux specificallyplatform-macBuilding on or for macOS specificallyplatform-webWeb applications specificallyteam-text-inputOwned by Text Input team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions