Fix for not being able to use F10 key

Closes #310
This commit is contained in:
Daniel Collin 2023-02-18 12:56:43 +01:00
parent f92e38a181
commit b48e531e8d

View file

@ -207,6 +207,12 @@ unsafe extern "system" fn wnd_proc(
let mut wnd: &mut Window = mem::transmute(user_data); let mut wnd: &mut Window = mem::transmute(user_data);
match msg { match msg {
winuser::WM_SYSCOMMAND => {
if wparam == winuser::SC_KEYMENU {
return 0;
}
}
winuser::WM_MOUSEWHEEL => { winuser::WM_MOUSEWHEEL => {
let scroll = ((((wparam as u32) >> 16) & 0xffff) as i16) as f32 * 0.1; let scroll = ((((wparam as u32) >> 16) & 0xffff) as i16) as f32 * 0.1;
wnd.mouse.scroll = scroll; wnd.mouse.scroll = scroll;
@ -224,6 +230,11 @@ unsafe extern "system" fn wnd_proc(
return 0; return 0;
} }
winuser::WM_SYSKEYDOWN => {
update_key_state(wnd, (lparam as u32) >> 16, true);
return 0;
}
winuser::WM_CHAR => { winuser::WM_CHAR => {
char_down(wnd, wparam as u32); char_down(wnd, wparam as u32);
} }
@ -269,6 +280,11 @@ unsafe extern "system" fn wnd_proc(
return 0; return 0;
} }
winuser::WM_SYSKEYUP => {
update_key_state(wnd, (lparam as u32) >> 16, false);
return 0;
}
winuser::WM_COMMAND => { winuser::WM_COMMAND => {
if lparam == 0 { if lparam == 0 {
wnd.accel_key = (wparam & 0xffff) as usize; wnd.accel_key = (wparam & 0xffff) as usize;