From 6918e275d0076ee15c503f7393b110f4675f6e70 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 28 Nov 2025 18:43:59 +0800 Subject: [PATCH] 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 --- services/bao1x-hal-service/src/servers/keyboard.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/bao1x-hal-service/src/servers/keyboard.rs b/services/bao1x-hal-service/src/servers/keyboard.rs index 08b39439c..49657a8e5 100644 --- a/services/bao1x-hal-service/src/servers/keyboard.rs +++ b/services/bao1x-hal-service/src/servers/keyboard.rs @@ -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}', }