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.

windows: Don't report 'shift' for certain keys (#9479)

Ezekiel Warren9f96c43ff7c5
diff --git a/crates/gpui/src/platform/windows/window.rs b/crates/gpui/src/platform/windows/window.rs
index 084d5727437..04939657bb9 100644
--- a/crates/gpui/src/platform/windows/window.rs
+++ b/crates/gpui/src/platform/windows/window.rs
@@ -455,8 +455,14 @@ impl WindowsWindowInner {
if first_char.is_control() {
None
} else {
+ let mut modifiers = self.current_modifiers();
+ // for characters that use 'shift' to type it is expected that the
+ // shift is not reported if the uppercase/lowercase are the same and instead only the key is reported
+ if first_char.to_lowercase().to_string() == first_char.to_uppercase().to_string() {
+ modifiers.shift = false;
+ }
Some(Keystroke {
- modifiers: self.current_modifiers(),
+ modifiers,
key: first_char.to_lowercase().to_string(),
ime_key: Some(first_char.to_string()),
})