diff options
author | Juan Luis Boya GarcĂa <ntrrgc@gmail.com> | 2013-10-16 17:34:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-25 14:51:30 +0200 |
commit | fcebbaeba37422780afd58a1a63954bdbf1a67e2 (patch) | |
tree | 19af7bec2ed4573cf49fa33364cad6d4876d8412 /src/plugins/platforms/windows/qtwindowsglobal.h | |
parent | c3f6a5d93b2439fc7a821e1b9d83f0aa996805bf (diff) |
Fix virtual key mapping on MS Windows
In order to map MS Windows virtual keys to Qt keys without messing with
dead keys now I use the built-in keyMap structure of QWindowsKeyMapper
and assert every cell in the keymap is properly updated.
In order to guarantee this even when the user changes the keyboard
layout, WndProc now manages the WM_INPUTLANGCHANGE message, which is
handled by QWindowsKeyMapper, resetting the layout structure.
I don't fully understand yet some things about QWindowsKeyMapper, i.e.
how QWindowsKeyMapper::updatePossibleKeyCodes workarounds the dead key
issue with ToAscii; but it seems to work fine in all the tests I've
done. Any further testing is highly appreciated, though.
[ChangeLog][[QtGui][Platform Specific Changes][Windows] Fixed virtual key
mapping on Windows.
Task-number: QTBUG-33409
Task-number: QTBUG-8764
Task-number: QTBUG-10032
Change-Id: I4f7709a90906b03f4504deea1ff5c361e9f94b3f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qtwindowsglobal.h')
-rw-r--r-- | src/plugins/platforms/windows/qtwindowsglobal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h index f6ed9447ef..7b574b0a56 100644 --- a/src/plugins/platforms/windows/qtwindowsglobal.h +++ b/src/plugins/platforms/windows/qtwindowsglobal.h @@ -93,6 +93,7 @@ enum WindowsEventType // Simplify event types NonClientHitTest = NonClientEventFlag + 2, KeyEvent = KeyEventFlag + 1, KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1, + KeyboardLayoutChangeEvent = KeyEventFlag + 2, InputMethodKeyEvent = InputMethodEventFlag + KeyEventFlag + 1, InputMethodKeyDownEvent = InputMethodEventFlag + KeyEventFlag + KeyDownEventFlag + 1, ClipboardEvent = ClipboardEventFlag + 1, @@ -165,6 +166,10 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI return QtWindows::InputMethodKeyEvent; case WM_IME_KEYDOWN: return QtWindows::InputMethodKeyDownEvent; +#ifdef WM_INPUTLANGCHANGE + case WM_INPUTLANGCHANGE: + return QtWindows::KeyboardLayoutChangeEvent; +#endif // WM_INPUTLANGCHANGE case WM_TOUCH: return QtWindows::TouchEvent; case WM_CHANGECBCHAIN: |