From ecdf560dff816e8cc25717a165e321c0cf8eacbd Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 13 Aug 2025 15:48:19 +0200 Subject: [PATCH] Fix altgr conflicting with keybindings --- crates/gpui/src/platform/windows/events.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rs index 4ab257d27a..1a0c81f32d 100644 --- a/crates/gpui/src/platform/windows/events.rs +++ b/crates/gpui/src/platform/windows/events.rs @@ -1452,9 +1452,18 @@ fn is_virtual_key_pressed(vkey: VIRTUAL_KEY) -> bool { #[inline] pub(crate) fn current_modifiers() -> Modifiers { + let is_altgr = is_virtual_key_pressed(VK_RMENU) && is_virtual_key_pressed(VK_CONTROL); Modifiers { - control: is_virtual_key_pressed(VK_CONTROL), - alt: is_virtual_key_pressed(VK_MENU), + control: if is_altgr { + false + } else { + is_virtual_key_pressed(VK_CONTROL) + }, + alt: if is_altgr { + false + } else { + is_virtual_key_pressed(VK_MENU) + }, shift: is_virtual_key_pressed(VK_SHIFT), platform: is_virtual_key_pressed(VK_LWIN) || is_virtual_key_pressed(VK_RWIN), function: false,