alt key should work now
This commit is contained in:
parent
b953466376
commit
225df7c08c
1 changed files with 4 additions and 7 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue