From 95b311cb907cff1ec21943f1de3c7bed6f5561f0 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Mon, 11 Mar 2024 09:03:15 -0700 Subject: [PATCH] linux: gpui add Keysym::ISO_Left_Tab (#9126) Fixes #9089. On linux, pressing shift and tab together can potentially produce `ISO_Left_Tab`. This PR maps this key to "tab" with the shift modifier, similar to `SHIFT_TAB_KEY` in gpui::platform::mac::events. Note: The [default linux keymaps](https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-linux.json) have shift-tab mapped to editor::TabPrev and ctrl-[ mapped to editor::Outdent. Both actions appear to have the same effect. Release Notes: - Support shift-tab on linux (#9089). --- crates/gpui/src/platform/linux/util.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/gpui/src/platform/linux/util.rs b/crates/gpui/src/platform/linux/util.rs index f5b90541f08504200f04d823860923a484fe9e16..543ebbeae358a7d6cc3af0402a36dd34cf793837 100644 --- a/crates/gpui/src/platform/linux/util.rs +++ b/crates/gpui/src/platform/linux/util.rs @@ -60,6 +60,11 @@ impl Keystroke { Keysym::equal => "=".to_owned(), Keysym::plus => "+".to_owned(), + Keysym::ISO_Left_Tab => { + handle_consumed_modifiers = false; + "tab".to_owned() + } + _ => { handle_consumed_modifiers = false; xkb::keysym_get_name(key_sym).to_lowercase()