KeyEvent: Support modifiers / UI: Open file chooser on ctrl-O (#707)

* file chooser on ctrl-o

* typo fix
This commit is contained in:
IndieDriver
2017-06-07 20:25:38 +02:00
committed by Justin Moore
parent 8cf8707d4e
commit 8e1c0201ad
3 changed files with 27 additions and 4 deletions

View File

@@ -572,8 +572,10 @@ bool Win32Window::HandleMouse(UINT message, WPARAM wParam, LPARAM lParam) {
}
bool Win32Window::HandleKeyboard(UINT message, WPARAM wParam, LPARAM lParam) {
auto e = KeyEvent(this, static_cast<int>(wParam), lParam & 0xFFFF0000,
!!(lParam & 0x2));
auto e = KeyEvent(
this, static_cast<int>(wParam), lParam & 0xFFFF0000, !!(lParam & 0x2),
!!(GetKeyState(VK_SHIFT) & 0x80), !!(GetKeyState(VK_CONTROL) & 0x80),
!!(GetKeyState(VK_MENU) & 0x80), !!(GetKeyState(VK_LWIN) & 0x80));
switch (message) {
case WM_KEYDOWN:
OnKeyDown(&e);