git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit0bfa6ce722f2f05238a9b74c65f513096550e572
parent6d9c0311ea
authorLucas Galante <[email protected]>
date2026-08-11 22:15
match_key_shortcut: honor the alt modifier

KeyEvent carries alt now, so "alt" / "meta" chord tokens require it and
chords without them require its absence — previously the token parsed as
a no-op and alt+X chords were unwritable. Super tokens stay ignored:
super chords belong to the compositor and never reach a client.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/widget/mod.rs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/widget/mod.rs b/src/widget/mod.rs
index 478b1d8..be32ca0 100644
--- a/src/widget/mod.rs
+++ b/src/widget/mod.rs
@@ -659,19 +659,23 @@ pub fn match_key_shortcut(event: &KeyEvent, shortcut_str: &str) -> bool {
     
     let mut req_ctrl = false;
     let mut req_shift = false;
+    let mut req_alt = false;
     let mut req_key = "";
-    
+
     for part in parts {
         match part {
             "ctrl" | "control" => req_ctrl = true,
             "shift" => req_shift = true,
-            "super" | "win" | "logo" | "alt" | "meta" => {}
+            "alt" | "meta" => req_alt = true,
+            // Super chords belong to the compositor; a client never sees them.
+            "super" | "win" | "logo" => {}
             k => req_key = k,
         }
     }
-    
+
     if event.ctrl != req_ctrl { return false; }
     if event.shift != req_shift { return false; }
+    if event.alt != req_alt { return false; }
     
     if let Key::Character(ref ch) = event.logical_key {
         let ch_lower = ch.to_lowercase();