Windows: Add Key_Backtab as possible key combination for Shift+Tab

In windows Backtab key event always comes as "Shift+Backtab".
So in order for Backtab key to be recognized as a shortcut sequence,
we also consider Backtab without shift modifier a possibility.

Fixes: QTBUG-94890
Change-Id: I20a7b404b57d8df5bea23765257a178f2e098ed0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4d9f99c4ea70cdae58c80e1bfdbabefe3abb455f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6d8afaac84f995cfb008bd2d3eb59fe4fe10dd69)
This commit is contained in:
Morteza Jamshidi 2024-09-30 15:06:31 +02:00 committed by Qt Cherry-pick Bot
parent 6e32a2e065
commit 4df1256cff
2 changed files with 7 additions and 0 deletions

View File

@ -1354,6 +1354,11 @@ QList<QKeyCombination> QWindowsKeyMapper::possibleKeyCombinations(const QKeyEven
return result;
}
// If Key_Tab+Shift is pressed we add Key_Backtab without
// shift modifier as a possible combination too
if (baseKey == Qt::Key_Tab && (keyMods & Qt::ShiftModifier))
result << (Qt::Key_Backtab | (keyMods & ~Qt::ShiftModifier));
// The base key is _always_ valid, of course
result << QKeyCombination::fromCombined(int(baseKey) + int(keyMods));

View File

@ -102,6 +102,8 @@ void ShortcutTester::setupLayout()
Qt::ControlModifier | Qt::Key_BracketRight,
Qt::ShiftModifier | Qt::Key_F3,
Qt::ControlModifier | Qt::Key_F3,
Qt::Key_Backtab,
Qt::ShiftModifier | Qt::Key_Backtab,
};
for (const auto k : keys3)