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: Fix handling of AltGr to avoid conflicts (#38925)

Antal Szabó15580a867b1e
diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rs
index 3a51c7ad6d1..a9873c109c7 100644
--- a/crates/gpui/src/platform/windows/events.rs
+++ b/crates/gpui/src/platform/windows/events.rs
@@ -1449,9 +1449,11 @@ fn is_virtual_key_pressed(vkey: VIRTUAL_KEY) -> bool {
#[inline]
pub(crate) fn current_modifiers() -> Modifiers {
+ let altgr = is_virtual_key_pressed(VK_RMENU) && is_virtual_key_pressed(VK_LCONTROL);
+
Modifiers {
- control: is_virtual_key_pressed(VK_CONTROL),
- alt: is_virtual_key_pressed(VK_MENU),
+ control: is_virtual_key_pressed(VK_CONTROL) && !altgr,
+ alt: is_virtual_key_pressed(VK_MENU) && !altgr,
shift: is_virtual_key_pressed(VK_SHIFT),
platform: is_virtual_key_pressed(VK_LWIN) || is_virtual_key_pressed(VK_RWIN),
function: false,