Skip to content

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

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

Activity

  1. self-assigned this
    on Mar 21, 2022
  2. added
    a: text inputEntering text in a text field or keyboard related problems
    platform-macosBuilding on or for macOS specifically
    platform-webWeb applications specifically
    platform-linuxBuilding on or for Linux specifically
    P2Important issues not at the top of the work list
    on Mar 21, 2022
  3. added
    fyi-macosFor the attention of macOS platform team
    fyi-windowsFor the attention of the Windows platform team
    fyi-linuxFor the attention of the Linux platform team
    and removed on Jun 5, 2024
  4. flutter-triage-bot commented on Jun 7, 2024

    @flutter-triage-bot

    The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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-macosBuilding 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