From 9c5323927658c2a66e52d9681c10fe1004eabc84 Mon Sep 17 00:00:00 2001 From: futile Date: Thu, 17 Apr 2025 02:25:07 +0100 Subject: [PATCH] remove an i32 cast from `is_any_key_pressed` --- src/util/win.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/win.rs b/src/util/win.rs index b15b1e6..708feec 100644 --- a/src/util/win.rs +++ b/src/util/win.rs @@ -44,7 +44,7 @@ pub fn is_window_focused(target_title: &str) -> bool { pub fn is_any_key_pressed(keys: &[u8]) -> bool { keys.iter() - .any(|&key| unsafe { (i32::from(GetAsyncKeyState(i32::from(key))) & 0x8000) != 0 }) + .any(|&key| unsafe { (GetAsyncKeyState(i32::from(key)) & i16::MIN) != 0 }) } pub fn elevate(closing: ElevationExitMethod) {