Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add support for numpad keys on linux (#14018)

Mikayla Makiba28827de565
diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs
index f7c86399739..9f613d1ca5b 100644
--- a/crates/gpui/src/platform/linux/platform.rs
+++ b/crates/gpui/src/platform/linux/platform.rs
@@ -640,6 +640,8 @@ impl Keystroke {
Keysym::Prior => "pageup".to_owned(),
Keysym::Next => "pagedown".to_owned(),
Keysym::ISO_Left_Tab => "tab".to_owned(),
+ Keysym::KP_Prior => "pageup".to_owned(),
+ Keysym::KP_Next => "pagedown".to_owned(),
Keysym::comma => ",".to_owned(),
Keysym::period => ".".to_owned(),
@@ -677,7 +679,14 @@ impl Keystroke {
Keysym::equal => "=".to_owned(),
Keysym::plus => "+".to_owned(),
- _ => xkb::keysym_get_name(key_sym).to_lowercase(),
+ _ => {
+ let name = xkb::keysym_get_name(key_sym).to_lowercase();
+ if key_sym.is_keypad_key() {
+ name.replace("kp_", "")
+ } else {
+ name
+ }
+ }
};
if modifiers.shift {