call DefWindowProc in the case of WM_SYSKEYDOWN. makes alt-f4 work.
if we call DefWindowProc for non-system events, pressing alt or f10 puts focus on the (nonexistent) dropdown menu until the next click or keystroke, so we only call it in the case of WM_SYSKEYDOWN.
This commit is contained in:
parent
08e56bd5ae
commit
ab0cb10a22
|
@ -151,8 +151,6 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
|
||||||
},
|
},
|
||||||
WM_CHAR | WM_SYSCHAR | WM_KEYDOWN | WM_SYSKEYDOWN | WM_KEYUP
|
WM_CHAR | WM_SYSCHAR | WM_KEYDOWN | WM_SYSKEYDOWN | WM_KEYUP
|
||||||
| WM_SYSKEYUP | WM_INPUTLANGCHANGE => {
|
| WM_SYSKEYUP | WM_INPUTLANGCHANGE => {
|
||||||
// Will swallow menu key events. See druid code for how to
|
|
||||||
// solve that
|
|
||||||
let opt_event = window_state.borrow_mut()
|
let opt_event = window_state.borrow_mut()
|
||||||
.keyboard_state
|
.keyboard_state
|
||||||
.process_message(hwnd, msg, wparam, lparam);
|
.process_message(hwnd, msg, wparam, lparam);
|
||||||
|
@ -163,7 +161,9 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
|
||||||
.on_event(&mut window, Event::Keyboard(event));
|
.on_event(&mut window, Event::Keyboard(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
if msg != WM_SYSKEYDOWN {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue