map the center key to "fire"

This allows the center key to be used as a UI trigger action
without creating a carriage return on the console. this prevents
console actions from errantly triggering during complex ui navs.

probably later on we should filter out more of the UI nav items
going to the console because the console is always listening
This commit is contained in:
bunnie 2025-11-28 18:43:59 +08:00
parent 7631ad9e20
commit 6918e275d0

View file

@ -132,6 +132,10 @@ fn map_keypress(kp: KeyPress) -> char {
KeyPress::Left => '←',
KeyPress::Right => '→',
KeyPress::Select => '∴',
// "Fire" is used as the mapping for the center instead of carriage return ('\r' (0xd))
// because carriage return is reserved for the shell to indicate the end of line. Thus
// by mapping "fire" to the center key, we get a UI-specific action key without invoking
// shell commands in the background unintentionally.
KeyPress::Center => '🔥',
_ => '\u{0000}',
}