windows extended key

This commit is contained in:
sj6219 2023-01-06 20:07:43 +09:00
parent 56e699a5e6
commit c5e39f4bbb

View File

@ -56,6 +56,20 @@ fn keybd_event(flags: u32, vk: u16, scan: u16) -> DWORD {
input.type_ = INPUT_KEYBOARD;
unsafe {
let dst_ptr = (&mut input.u as *mut _) as *mut u8;
let flags = match vk as _ {
winapi::um::winuser::VK_HOME |
winapi::um::winuser::VK_UP |
winapi::um::winuser::VK_PRIOR |
winapi::um::winuser::VK_LEFT |
winapi::um::winuser::VK_RIGHT |
winapi::um::winuser::VK_END |
winapi::um::winuser::VK_DOWN |
winapi::um::winuser::VK_NEXT |
winapi::um::winuser::VK_INSERT |
winapi::um::winuser::VK_DELETE => flags | winapi::um::winuser::KEYEVENTF_EXTENDEDKEY,
_ => flags,
};
let k = KEYBDINPUT {
wVk: vk,
wScan: scan,