feat(input): bind Plan 9 arrow-key runes (fixes down-arrow in alacritty9) - #158
feat(input): bind Plan 9 arrow-key runes (fixes down-arrow in alacritty9)#158mparrett wants to merge 1 commit into
Conversation
…ty9) Movement bindings carried only the ANSI arrow escapes (ESC[A/B/C/D). On Plan 9 the arrow keys can arrive as kernel runes instead — Kup U+F00E, Kdown U+F800, Kleft U+F011, Kright U+F012 — and which form a terminal sends varies: - alacritty9 (the main play environment) sends ANSI for up/left/right but the raw Kdown rune for DOWN. Measured on 9front: without the U+F800 binding, down-movement is dead in-game while the other three work. - the bare text console sends all four as runes. - rio's own windows swallow the arrows for scrollback (unreachable either way). Bind both forms per direction so movement works wherever a key reaches us. Adds input_test.lg coverage for the rune bindings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bare-console confirmation: all four runes on real hardwareThe PR body measured only the alacritty9 down-arrow; the other three rune values came from ( So the two device paths together cover every key this binds: the bare console sends all four as runes, and alacritty9 sends ANSI for up/left/right plus the Kdown rune for down. |
|
Just a hunch, this PR seems like it's trying to fix something that shouldn't be that way in the first place. The "raw Kdown rune U+F800 for down" part smells like a bug rather than something to accommodate here- Not proven, but need to take a deeper look. |
What
Movement keys bound only the ANSI arrow escapes (
ESC[A/B/C/D). This adds Plan 9's kernel arrow runes (KupU+F00E, KdownU+F800, KleftU+F011, KrightU+F012) alongside them, so the arrow keys drive movement on the Plan 9 terminals that deliver runes instead of escapes.Why it's not cosmetic
Which form a terminal sends isn't uniform, and the gap lands on the main play environment:
U+F800for down. Measured on 9front amd64: without theU+F800binding, up/left/right move and down does nothing.The down case is the one that bites: a silent dead key in the primary environment, easy to miss because hjkl and the numpad still move you.
Evidence
Probed on real hardware (9front amd64 + alacritty9) with a
read-keycodepoint dump, entering the alternate screen the way the game does:The let-go side (
read-keytokenizing these on Plan 9) is nooga/let-go#461; this is the xsofy-side binding that consumes them.Test
input_test.lgcovers the rune bindings resolving to the right movement actions.Closes #157.