Skip to content

android: add missing support for key modifiers - #403

Merged
not-fl3 merged 1 commit into
not-fl3:masterfrom
narodnik:foo
Aug 7, 2023
Merged

not-fl3 merged 1 commit into
not-fl3:masterfrom
narodnik:foo

Conversation

@narodnik

@narodnik narodnik commented Aug 7, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@not-fl3
not-fl3 merged commit 3d5637c into not-fl3:master Aug 7, 2023
@narodnik
narodnik deleted the foo branch June 29, 2025 15:52
not-fl3 pushed a commit that referenced this pull request May 20, 2026
The translation table only covered letters, digits, arrows,
Enter, Tab, Space, Backspace, Shift / Alt, comma + period —
which means a hardware keyboard on Android (tablet + Bluetooth /
USB / Magic Keyboard; ChromeOS; Stage Manager iPad with a Mac
keyboard) couldn't reach the host app with most of its keys.

Adds the keys that have a clear semantic and a matching `KeyCode`
variant:

- Modifiers: Ctrl L/R, Meta L/R (Cmd on Apple keyboards), CapsLock,
  NumLock, ScrollLock. PR #403 already wired the `KeyMods` tracking
  for Ctrl / Super, but that's a no-op as long as the keycodes
  themselves translate to `KeyCode::Unknown`.
- Edit cluster: Escape, Insert, Delete (`KEYCODE_FORWARD_DEL`,
  distinct from the existing `KEYCODE_DEL` → Backspace), MoveHome,
  MoveEnd, PageUp, PageDown, PrintScreen / Pause.
- Punctuation: `=`, `[`, `]`, `\\`, `;`, `/`, backtick.
- Menu (KEYCODE_MENU, the soft-menu / context-menu key on tablets).
- F1–F12.
- Numpad: 0–9 + the four arithmetic ops + dot + Enter + equals.

Keeps the existing `KEYCODE_HOME` (0x03) entry that maps the device
home button to `KeyCode::Home`; in practice that keycode doesn't
reach app input anyway and the new `KEYCODE_MOVE_HOME` (0x7a) maps
to the same variant for the cursor-home case.

Verified on a Pixel Tablet AVD against `is_key_pressed(Escape)`,
`is_key_down(LeftControl)`, and `is_key_pressed(KpEnter)`.
TheRedDeveloper pushed a commit to TheRedDeveloper/miniquad-fix that referenced this pull request Aug 12, 2026
The translation table only covered letters, digits, arrows,
Enter, Tab, Space, Backspace, Shift / Alt, comma + period —
which means a hardware keyboard on Android (tablet + Bluetooth /
USB / Magic Keyboard; ChromeOS; Stage Manager iPad with a Mac
keyboard) couldn't reach the host app with most of its keys.

Adds the keys that have a clear semantic and a matching `KeyCode`
variant:

- Modifiers: Ctrl L/R, Meta L/R (Cmd on Apple keyboards), CapsLock,
  NumLock, ScrollLock. PR not-fl3#403 already wired the `KeyMods` tracking
  for Ctrl / Super, but that's a no-op as long as the keycodes
  themselves translate to `KeyCode::Unknown`.
- Edit cluster: Escape, Insert, Delete (`KEYCODE_FORWARD_DEL`,
  distinct from the existing `KEYCODE_DEL` → Backspace), MoveHome,
  MoveEnd, PageUp, PageDown, PrintScreen / Pause.
- Punctuation: `=`, `[`, `]`, `\\`, `;`, `/`, backtick.
- Menu (KEYCODE_MENU, the soft-menu / context-menu key on tablets).
- F1–F12.
- Numpad: 0–9 + the four arithmetic ops + dot + Enter + equals.

Keeps the existing `KEYCODE_HOME` (0x03) entry that maps the device
home button to `KeyCode::Home`; in practice that keycode doesn't
reach app input anyway and the new `KEYCODE_MOVE_HOME` (0x7a) maps
to the same variant for the cursor-home case.

Verified on a Pixel Tablet AVD against `is_key_pressed(Escape)`,
`is_key_down(LeftControl)`, and `is_key_pressed(KpEnter)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants