qxkbcommon: Map Super/Hyper to Meta early enough to have an effect
Super/Hyper keys are detected during a direct mapping phase, but the function returned before the translation to Meta could take place. Task-number: QTBUG-62102 Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Andrey Butirsky <butirsky@gmail.com> (cherry picked from commit b45b9090c3b66d541f57f8d049c22247f8c115ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
ec28a74a1c
commit
80fe72c6ec
@ -552,6 +552,12 @@ static int keysymToQtKey_internal(xkb_keysym_t keysym, Qt::KeyboardModifiers mod
|
||||
auto it = std::lower_bound(KeyTbl.cbegin(), KeyTbl.cend(), searchKey);
|
||||
if (it != KeyTbl.end() && !(searchKey < *it))
|
||||
qtKey = it->qt;
|
||||
|
||||
// translate Super/Hyper keys to Meta if we're using them as the MetaModifier
|
||||
if (superAsMeta && (qtKey == Qt::Key_Super_L || qtKey == Qt::Key_Super_R))
|
||||
qtKey = Qt::Key_Meta;
|
||||
if (hyperAsMeta && (qtKey == Qt::Key_Hyper_L || qtKey == Qt::Key_Hyper_R))
|
||||
qtKey = Qt::Key_Meta;
|
||||
}
|
||||
|
||||
if (qtKey)
|
||||
@ -578,12 +584,6 @@ static int keysymToQtKey_internal(xkb_keysym_t keysym, Qt::KeyboardModifiers mod
|
||||
}
|
||||
}
|
||||
|
||||
// translate Super/Hyper keys to Meta if we're using them as the MetaModifier
|
||||
if (superAsMeta && (qtKey == Qt::Key_Super_L || qtKey == Qt::Key_Super_R))
|
||||
qtKey = Qt::Key_Meta;
|
||||
if (hyperAsMeta && (qtKey == Qt::Key_Hyper_L || qtKey == Qt::Key_Hyper_R))
|
||||
qtKey = Qt::Key_Meta;
|
||||
|
||||
return qtKey;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user