5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 19:21:21 +08:00

[windows] Fix #2359 by not redirecting the accelerators to wndproc

If someone wants to handle accelerators they could use the key
bindings in a cross-platform way.
This commit is contained in:
stffabi 2023-12-07 07:55:04 +01:00
parent 2f3eb70a4d
commit 012eeab3aa

View File

@ -1322,13 +1322,7 @@ func (w *windowsWebviewWindow) setupChromium() {
chromium.WebResourceRequestedCallback = w.processRequest
chromium.ContainsFullScreenElementChangedCallback = w.fullscreenChanged
chromium.NavigationCompletedCallback = w.navigationCompleted
chromium.AcceleratorKeyCallback = func(vkey uint) bool {
if w.processKeyBinding(vkey) {
return true
}
w32.PostMessage(w.hwnd, w32.WM_KEYDOWN, uintptr(vkey), 0)
return false
}
chromium.AcceleratorKeyCallback = w.processKeyBinding
chromium.Embed(w.hwnd)