Skip to content

Adds the keyboard mapping for Linux - #29993

Merged
franciscojma86 merged 9 commits into
flutter:masterfrom
franciscojma86:glfw
Mar 28, 2019
Merged

franciscojma86 merged 9 commits into
flutter:masterfrom
franciscojma86:glfw

Conversation

@franciscojma86

Copy link
Copy Markdown
Contributor

Specifically, the GLFW key code mapping since that's the current window implementation on the flutter desktop embedding project. It can extended to more implementations. GLFW offers a limited set of key codes, and requires custom logic from the embedder to provide the right values.

X11 doesn't seem to provide different keys for left/right modifiers so the side defaults to 'any'
https://code.woboq.org/qt5/include/X11/X.h.html#_M/ShiftMask

Example of data produced:
RawKeyEventDataLinux(keyLabel: $, keyCode: 52, scanCode: 13, codePoint: 36, modifiers: 1, modifiers down: {ModifierKey.shiftModifier: KeyboardSide.any})
LogicalKeyboardKey#00024(keyId: "0x00000024", keyLabel: "$", debugName: "Key $")
PhysicalKeyboardKey#70021(usbHidUsage: "0x00070021", debugName: "Digit 4")

This is not a breaking change.

Specifically, the GLFW key code mapping since that's the current
implementation on the flutter desktop embedding project. It can be
extended to more implementations.
Comment thread packages/flutter/lib/src/services/linux_key_helper.dart Outdated
@goderbauer goderbauer added a: desktop Running on desktop framework flutter/packages/flutter repository. See also f: labels. labels Mar 26, 2019
@franciscojma86
franciscojma86 marked this pull request as ready for review March 27, 2019 01:15

@gspencergoog gspencergoog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Comment thread packages/flutter/lib/src/services/raw_keyboard_linux.dart Outdated
Comment thread packages/flutter/lib/src/services/raw_keyboard_linux.dart Outdated
Comment thread packages/flutter/lib/src/services/raw_keyboard_linux.dart Outdated
@franciscojma86
franciscojma86 merged commit b70d260 into flutter:master Mar 28, 2019
@franciscojma86
franciscojma86 deleted the glfw branch January 21, 2020 21:15
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: desktop Running on desktop framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants