fix mismatching buffer sizes

This commit is contained in:
LordMZTE 2020-08-25 16:47:45 +02:00
parent 9fcc843f5c
commit ac61409ef4

View file

@ -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', "")
}
}