mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-20 21:44:06 +01:00
Windows: Fix execution of keyboard menu shortcuts (issue #1387).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1967 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
833f762273
commit
04e072ca40
@ -747,6 +747,37 @@ void CefBrowserHostImpl::PlatformHandleKeyboardEvent(
|
||||
if (event.os_event) {
|
||||
const MSG& msg = event.os_event->native_event();
|
||||
DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
} else {
|
||||
MSG msg = {};
|
||||
|
||||
msg.hwnd = PlatformGetWindowHandle();
|
||||
if (!msg.hwnd)
|
||||
return;
|
||||
|
||||
switch (event.type) {
|
||||
case blink::WebInputEvent::RawKeyDown:
|
||||
msg.message = event.isSystemKey ? WM_SYSKEYDOWN : WM_KEYDOWN;
|
||||
break;
|
||||
case blink::WebInputEvent::KeyUp:
|
||||
msg.message = event.isSystemKey ? WM_SYSKEYUP : WM_KEYUP;
|
||||
break;
|
||||
case blink::WebInputEvent::Char:
|
||||
msg.message = event.isSystemKey ? WM_SYSCHAR: WM_CHAR;
|
||||
break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
return;
|
||||
}
|
||||
|
||||
msg.wParam = event.windowsKeyCode;
|
||||
|
||||
UINT scan_code = ::MapVirtualKeyW(event.windowsKeyCode, MAPVK_VK_TO_VSC);
|
||||
msg.lParam = (scan_code << 16) | // key scan code
|
||||
1; // key repeat count
|
||||
if (event.modifiers & content::NativeWebKeyboardEvent::AltKey)
|
||||
msg.lParam |= (1 << 29);
|
||||
|
||||
DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user