From ac6c4f3ca811a3d0a4698442d2d38f72ff8447bc Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Tue, 19 Mar 2024 10:35:28 -0700 Subject: [PATCH] windows: fix 'space' keystroke keydown event (#9476) the space key was being reported as key " " which didn't allow it to be used in keybindings Release Notes: - N/A --- crates/gpui/src/platform/windows/window.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/windows/window.rs b/crates/gpui/src/platform/windows/window.rs index 21f82b093c..8dae41bb8b 100644 --- a/crates/gpui/src/platform/windows/window.rs +++ b/crates/gpui/src/platform/windows/window.rs @@ -484,9 +484,13 @@ impl WindowsWindowInner { if first_char.to_lowercase().to_string() == first_char.to_uppercase().to_string() { modifiers.shift = false; } + let key = match first_char { + ' ' => "space".to_string(), + first_char => first_char.to_lowercase().to_string(), + }; Some(Keystroke { modifiers, - key: first_char.to_lowercase().to_string(), + key, ime_key: Some(first_char.to_string()), }) }