diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-07-17 15:06:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-07-17 16:35:42 +0200 |
commit | b2603b76655ac819e43c063bb6f16bc95f358083 (patch) | |
tree | 0fbe2c367ebfffdb70e9e3f21a7cf408bafd9626 /src/platformsupport | |
parent | 99b94aadf875c822afb6c2580e43355ac392ac92 (diff) | |
parent | 756266d01560157b7274e466b9ffc1b0e2ef9a1f (diff) |
Merge remote-tracking branch 'origin/5.5' into HEAD
Conflicts:
src/plugins/platforms/windows/qwindowsopengltester.cpp
Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index 16cb94dded..06751de0ef 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -379,17 +379,20 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint } if (!skip) { - qCDebug(qLcEvdevKeyMap, "Processing: uni=%04x, qt=%08x, qtmod=%08x", unicode, qtcode & ~modmask, (qtcode & modmask)); - //If NumLockOff and keypad key pressed remap event sent - if (!m_locks[1] && - (qtcode & Qt::KeypadModifier) && + // Up until now qtcode contained both the key and modifiers. Split it. + Qt::KeyboardModifiers qtmods = Qt::KeyboardModifiers(qtcode & modmask); + qtcode &= ~modmask; + + qCDebug(qLcEvdevKeyMap, "Processing: uni=%04x, qt=%08x, qtmod=%08x", unicode, qtcode, int(qtmods)); + + // If NumLockOff and keypad key pressed remap event sent + if (!m_locks[1] && (qtmods & Qt::KeypadModifier) && keycode >= 71 && keycode <= 83 && keycode != 74 && keycode != 78) { unicode = 0xffff; - int oldMask = (qtcode & modmask); switch (keycode) { case 71: //7 --> Home qtcode = Qt::Key_Home; @@ -425,11 +428,14 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint qtcode = Qt::Key_Delete; break; } - qtcode ^= oldMask; } - // send the result to the server - processKeyEvent(keycode, unicode, qtcode & ~modmask, Qt::KeyboardModifiers(qtcode & modmask), pressed, autorepeat); + // Map SHIFT + Tab to SHIFT + Backtab, QShortcutMap knows about this translation + if (qtcode == Qt::Key_Tab && (qtmods & Qt::ShiftModifier) == Qt::ShiftModifier) + qtcode = Qt::Key_Backtab; + + // Generate the QPA event. + processKeyEvent(keycode, unicode, qtcode, qtmods, pressed, autorepeat); } } return result; |