alt key should work now

This commit is contained in:
LordMZTE 2020-08-26 15:29:16 +02:00
parent b953466376
commit 225df7c08c

View file

@ -1,6 +1,6 @@
use std::ffi::OsString;
use winapi::um::winuser::{GetKeyNameTextW, KBDLLHOOKSTRUCT, LLKHF_ALTDOWN, LLKHF_EXTENDED};
use winapi::um::winuser::{GetKeyNameTextW, KBDLLHOOKSTRUCT, LLKHF_EXTENDED};
use wio::wide::FromWide;
#[allow(clippy::struct_excessive_bools)]
@ -37,18 +37,15 @@ impl KeyState {
match key.vkCode {
160 | 161 => self.shift_down = key_down,
162 | 163 => self.ctrl_down = key_down,
164 | 165 => self.alt_down = key_down,
91 => self.win_down = key_down,
_ => {}
}
if key.flags & LLKHF_ALTDOWN != 0 {
self.alt_down = key_down
_ => {},
}
}
/// true if the key is an auxiliary key like shift, control or the windows key
pub fn is_aux_key(&self) -> bool {
matches!(self.kbdllstruct.vkCode, 160 | 161 | 162 | 163 | 91)
matches!(self.kbdllstruct.vkCode, 160..=165 | 91)
}
#[no_mangle]