From 397f1d0dc9346a3ee3537d7610aeaa490c5447a8 Mon Sep 17 00:00:00 2001 From: Michael Bikovitsky Date: Sat, 4 Feb 2023 14:11:59 +0200 Subject: [PATCH] Detect ALT key for mouse events on Windows --- window/src/os/windows/window.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/window/src/os/windows/window.rs b/window/src/os/windows/window.rs index aa914f5b7..44abfb651 100644 --- a/window/src/os/windows/window.rs +++ b/window/src/os/windows/window.rs @@ -1428,6 +1428,9 @@ fn mods_and_buttons(wparam: WPARAM) -> (Modifiers, MouseButtons) { if wparam & MK_SHIFT != 0 { modifiers |= Modifiers::SHIFT; } + if unsafe { GetKeyState(VK_MENU) } as u16 & 0x8000 != 0 { + modifiers |= Modifiers::ALT; + } if wparam & MK_LBUTTON != 0 { buttons |= MouseButtons::LEFT; }