the fallback for the case when the key is not found in the translated keys
table is the same as the one removed with this change anyway so the changes
done with this commit remove bad assumption about Qt::Key enum values,
deduplicates code and removes branch
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
Key_Super_R = 0xffec,
Key_Hyper_L = 0xffed,
Key_Hyper_R = 0xffee,
+
// latin
Key_Space = 0x0020,
Key_Exclam = 0x0021,
key &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier);
QString p;
- if (key && key < Qt::Key_Escape && key != Qt::Key_Space) {
- if (!QChar::requiresSurrogates(key)) {
- p = QChar::toUpper(ushort(key));
- } else {
- p += QChar(QChar::highSurrogate(key));
- p += QChar(QChar::lowSurrogate(key));
- }
- } else if (key >= Qt::Key_F1 && key <= Qt::Key_F35) {
+ if (key >= Qt::Key_F1 && key <= Qt::Key_F35) {
p = nativeText ? QShortcut::tr("F%1").arg(key - Qt::Key_F1 + 1)
: QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1);
} else if (key) {