You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
android: map the rest of the hardware-keyboard keycodes
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)`.
0 commit comments