change how vks are stored

This commit is contained in:
2025-04-18 05:26:28 +01:00
parent 668a6eb38b
commit 64e94bf790
2 changed files with 20 additions and 11 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ use windows::{
Security::{GetTokenInformation, TOKEN_ELEVATION, TOKEN_QUERY, TokenElevation},
System::Threading::{GetCurrentProcess, OpenProcessToken},
UI::{
Input::KeyboardAndMouse::GetAsyncKeyState,
Input::KeyboardAndMouse::{GetAsyncKeyState, VIRTUAL_KEY},
Shell::ShellExecuteW,
WindowsAndMessaging::{
CURSOR_SHOWING, CURSORINFO, GetCursorInfo, GetForegroundWindow, GetWindowTextW,
@@ -41,9 +41,9 @@ pub fn is_window_focused(target_title: &str) -> bool {
}
}
pub fn is_any_key_pressed(keys: &[u8]) -> bool {
pub fn is_any_key_pressed(keys: &[VIRTUAL_KEY]) -> bool {
keys.iter()
.any(|&key| unsafe { (GetAsyncKeyState(i32::from(key)) & i16::MIN) != 0 })
.any(|&key| unsafe { (GetAsyncKeyState(i32::from(key.0)) & i16::MIN) != 0 })
}
pub fn elevate(closing: ElevationExitMethod) {