fix mismatching buffer sizes
This commit is contained in:
parent
9fcc843f5c
commit
ac61409ef4
1 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,7 @@ pub mod logger;
|
|||
pub fn scan_code_to_key_name(scan_code: u32) -> String {
|
||||
unsafe {
|
||||
let mut out = [0u16; 128];
|
||||
GetKeyNameTextW((scan_code << 16) as i32, (&mut out).as_mut_ptr(), 1024);
|
||||
GetKeyNameTextW((scan_code << 16) as i32, (&mut out).as_mut_ptr(), 128);
|
||||
OsString::from_wide(&out).to_str().unwrap().replace('\0', "")
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue