Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Support for Back/Forward multimedia keys (#20695)
Peter Trippf01a86c64499
diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.jsonindex 664e13ee777..313ee024b56 100644--- a/assets/keymaps/default-linux.json+++ b/assets/keymaps/default-linux.json@@ -251,6 +251,8 @@"ctrl-pagedown": "pane::ActivateNextItem","ctrl-shift-pageup": "pane::SwapItemLeft","ctrl-shift-pagedown": "pane::SwapItemRight",+ "back": "pane::GoBack",+ "forward": "pane::GoForward","ctrl-w": "pane::CloseActiveItem","ctrl-f4": "pane::CloseActiveItem","alt-ctrl-t": ["pane::CloseInactiveItems", { "close_pinned": false }],diff --git a/crates/gpui/src/platform/keystroke.rs b/crates/gpui/src/platform/keystroke.rsindex f61beab9e9f..20a12a691b0 100644--- a/crates/gpui/src/platform/keystroke.rs+++ b/crates/gpui/src/platform/keystroke.rs@@ -222,6 +222,8 @@ fn is_printable_key(key: &str) -> bool {| "insert"| "home"| "end"+ | "back"+ | "forward"| "escape")}diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rsindex a2e9af691b5..f778ebc074e 100644--- a/crates/gpui/src/platform/linux/platform.rs+++ b/crates/gpui/src/platform/linux/platform.rs@@ -684,6 +684,8 @@ impl Keystroke {Keysym::ISO_Left_Tab => "tab".to_owned(),Keysym::KP_Prior => "pageup".to_owned(),Keysym::KP_Next => "pagedown".to_owned(),+ Keysym::XF86_Back => "back".to_owned(),+ Keysym::XF86_Forward => "forward".to_owned(),Keysym::comma => ",".to_owned(),Keysym::period => ".".to_owned(),diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rsindex 1f501f3341e..92adf6c7cb2 100644--- a/crates/gpui/src/platform/windows/events.rs+++ b/crates/gpui/src/platform/windows/events.rs@@ -1160,6 +1160,8 @@ fn parse_syskeydown_msg_keystroke(wparam: WPARAM) -> Option<Keystroke> {VK_END => "end",VK_PRIOR => "pageup",VK_NEXT => "pagedown",+ VK_BROWSER_BACK => "back",+ VK_BROWSER_FORWARD => "forward",VK_ESCAPE => "escape",VK_INSERT => "insert",VK_DELETE => "delete",@@ -1196,6 +1198,8 @@ fn parse_keydown_msg_keystroke(wparam: WPARAM) -> Option<KeystrokeOrModifier> {VK_END => "end",VK_PRIOR => "pageup",VK_NEXT => "pagedown",+ VK_BROWSER_BACK => "back",+ VK_BROWSER_FORWARD => "forward",VK_ESCAPE => "escape",VK_INSERT => "insert",VK_DELETE => "delete",