diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-02-09 21:31:39 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-02-09 21:31:39 -0300 |
commit | 3b3829e002c3a1c54115b606ee45e29d1c3a28ec (patch) | |
tree | 2f1a0352d8a2c1dc63bd8c135f173c09d78f1a0c /platform/windows | |
parent | 63a4faac3a9884bdab90e3a7bc3855d7fb68c1f2 (diff) | |
parent | a4f40ec3be67e6bd0498e18bc9c9f66274d29a48 (diff) |
Merge pull request #1259 from laganojunior/feature/fix_modifier_key_unpress
Modifiers are unset on events for the modifier key itself
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 4fa061886d..915e1a6098 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -593,10 +593,11 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { ERR_BREAK(key_event_pos >= KEY_EVENT_BUFFER_SIZE); + // Make sure we don't include modifiers for the modifier key itself. KeyEvent ke; - ke.mod_state.shift=shift_mem; - ke.mod_state.alt=alt_mem; - ke.mod_state.control=control_mem; + ke.mod_state.shift= (wParam != VK_SHIFT) ? shift_mem : false; + ke.mod_state.alt= (! (wParam == VK_MENU && (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN))) ? alt_mem : false; + ke.mod_state.control= (wParam != VK_CONTROL) ? control_mem : false; ke.mod_state.meta=meta_mem; ke.uMsg=uMsg; |