From b48e531e8dadf379a73e30fd005d004bd357514e Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Sat, 18 Feb 2023 12:56:43 +0100 Subject: [PATCH] Fix for not being able to use F10 key Closes #310 --- src/os/windows/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/os/windows/mod.rs b/src/os/windows/mod.rs index 2ea0511..1aec629 100644 --- a/src/os/windows/mod.rs +++ b/src/os/windows/mod.rs @@ -207,6 +207,12 @@ unsafe extern "system" fn wnd_proc( let mut wnd: &mut Window = mem::transmute(user_data); match msg { + winuser::WM_SYSCOMMAND => { + if wparam == winuser::SC_KEYMENU { + return 0; + } + } + winuser::WM_MOUSEWHEEL => { let scroll = ((((wparam as u32) >> 16) & 0xffff) as i16) as f32 * 0.1; wnd.mouse.scroll = scroll; @@ -224,6 +230,11 @@ unsafe extern "system" fn wnd_proc( return 0; } + winuser::WM_SYSKEYDOWN => { + update_key_state(wnd, (lparam as u32) >> 16, true); + return 0; + } + winuser::WM_CHAR => { char_down(wnd, wparam as u32); } @@ -269,6 +280,11 @@ unsafe extern "system" fn wnd_proc( return 0; } + winuser::WM_SYSKEYUP => { + update_key_state(wnd, (lparam as u32) >> 16, false); + return 0; + } + winuser::WM_COMMAND => { if lparam == 0 { wnd.accel_key = (wparam & 0xffff) as usize;