From 7d901c5e4761a09ad3875a304d8a6467576efcfe Mon Sep 17 00:00:00 2001 From: Junkui Zhang <364772080@qq.com> Date: Wed, 21 May 2025 15:30:07 +0800 Subject: [PATCH] parse immutable --- crates/gpui/src/platform/linux/platform.rs | 56 ++++++---------------- 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index af53899b437c244fd06d43b7963920c9596b94a0..b36c6a11717b734829901970a6974b052e3702b9 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -718,57 +718,31 @@ impl crate::Keystroke { let key_sym = state.key_get_one_sym(keycode); let key = match key_sym { + Keysym::space => "space".to_owned(), + Keysym::BackSpace => "backspace".to_owned(), Keysym::Return => "enter".to_owned(), - Keysym::Prior => "pageup".to_owned(), - Keysym::Next => "pagedown".to_owned(), + // Keysym::Tab => "tab".to_owned(), Keysym::ISO_Left_Tab => "tab".to_owned(), - Keysym::KP_Prior => "pageup".to_owned(), - Keysym::KP_Next => "pagedown".to_owned(), + Keysym::uparrow => "up".to_owned(), + Keysym::downarrow => "down".to_owned(), + Keysym::leftarrow => "left".to_owned(), + Keysym::rightarrow => "right".to_owned(), + Keysym::Home | Keysym::KP_Home => "home".to_owned(), + Keysym::End | Keysym::KP_End => "end".to_owned(), + Keysym::Prior | Keysym::KP_Prior => "pageup".to_owned(), + Keysym::Next | Keysym::KP_Next => "pagedown".to_owned(), Keysym::XF86_Back => "back".to_owned(), Keysym::XF86_Forward => "forward".to_owned(), + Keysym::Escape => "escape".to_owned(), + Keysym::Insert | Keysym::KP_Insert => "insert".to_owned(), + Keysym::Delete | Keysym::KP_Delete => "delete".to_owned(), + Keysym::Menu => "menu".to_owned(), Keysym::XF86_Cut => "cut".to_owned(), Keysym::XF86_Copy => "copy".to_owned(), Keysym::XF86_Paste => "paste".to_owned(), Keysym::XF86_New => "new".to_owned(), Keysym::XF86_Open => "open".to_owned(), Keysym::XF86_Save => "save".to_owned(), - - Keysym::comma => ",".to_owned(), - Keysym::period => ".".to_owned(), - Keysym::less => "<".to_owned(), - Keysym::greater => ">".to_owned(), - Keysym::slash => "/".to_owned(), - Keysym::question => "?".to_owned(), - - Keysym::semicolon => ";".to_owned(), - Keysym::colon => ":".to_owned(), - Keysym::apostrophe => "'".to_owned(), - Keysym::quotedbl => "\"".to_owned(), - - Keysym::bracketleft => "[".to_owned(), - Keysym::braceleft => "{".to_owned(), - Keysym::bracketright => "]".to_owned(), - Keysym::braceright => "}".to_owned(), - Keysym::backslash => "\\".to_owned(), - Keysym::bar => "|".to_owned(), - - Keysym::grave => "`".to_owned(), - Keysym::asciitilde => "~".to_owned(), - Keysym::exclam => "!".to_owned(), - Keysym::at => "@".to_owned(), - Keysym::numbersign => "#".to_owned(), - Keysym::dollar => "$".to_owned(), - Keysym::percent => "%".to_owned(), - Keysym::asciicircum => "^".to_owned(), - Keysym::ampersand => "&".to_owned(), - Keysym::asterisk => "*".to_owned(), - Keysym::parenleft => "(".to_owned(), - Keysym::parenright => ")".to_owned(), - Keysym::minus => "-".to_owned(), - Keysym::underscore => "_".to_owned(), - Keysym::equal => "=".to_owned(), - Keysym::plus => "+".to_owned(), - _ => { let name = xkb::keysym_get_name(key_sym).to_lowercase(); if key_sym.is_keypad_key() {