Merge pull request #1259 from laganojunior/feature/fix_modifier_key_unpress

Modifiers are unset on events for the modifier key itself
This commit is contained in:
Juan Linietsky 2015-02-09 21:31:39 -03:00
commit 3b3829e002

View file

@ -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); ERR_BREAK(key_event_pos >= KEY_EVENT_BUFFER_SIZE);
// Make sure we don't include modifiers for the modifier key itself.
KeyEvent ke; KeyEvent ke;
ke.mod_state.shift=shift_mem; ke.mod_state.shift= (wParam != VK_SHIFT) ? shift_mem : false;
ke.mod_state.alt=alt_mem; ke.mod_state.alt= (! (wParam == VK_MENU && (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN))) ? alt_mem : false;
ke.mod_state.control=control_mem; ke.mod_state.control= (wParam != VK_CONTROL) ? control_mem : false;
ke.mod_state.meta=meta_mem; ke.mod_state.meta=meta_mem;
ke.uMsg=uMsg; ke.uMsg=uMsg;