mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
app: prevent default Windows event handler from running for WM_SYSKEYUP/DOWN
F10 has a special meaning on Windows, if the default handler runs the first key press following F10 will not generate a key.Press event and if the first key press after F10 is space the window menu will be opened instead. Fixes #213 Signed-off-by: aarzilli <alessandro.arzilli@gmail.com>
This commit is contained in:
@@ -249,7 +249,14 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
|
||||
if msg == windows.WM_KEYUP || msg == windows.WM_SYSKEYUP {
|
||||
e.State = key.Release
|
||||
}
|
||||
|
||||
w.w.Event(e)
|
||||
|
||||
if (wParam == windows.VK_F10) && (msg == windows.WM_SYSKEYDOWN || msg == windows.WM_SYSKEYUP) {
|
||||
// Reserve F10 for ourselves, and don't let it open the system menu. Other Windows programs
|
||||
// such as cmd.exe and graphical debuggers also reserve F10.
|
||||
return 0
|
||||
}
|
||||
}
|
||||
case windows.WM_LBUTTONDOWN:
|
||||
w.pointerButton(pointer.ButtonPrimary, true, lParam, getModifiers())
|
||||
|
||||
Reference in New Issue
Block a user