Fix: Allow comma and semicolon in hotkey config (#7130)
This commit is contained in:
committed by
Chris Rizzitello
parent
938db301f0
commit
e5e53c02b5
@ -62,6 +62,8 @@ static const struct
|
||||
{Qt::Key_Launch0, "AppUser1"},
|
||||
{Qt::Key_Launch1, "AppUser2"},
|
||||
{Qt::Key_Select, "Select"},
|
||||
{Qt::Key_Comma, "Comma"},
|
||||
{Qt::Key_Semicolon, "Semicolon"},
|
||||
|
||||
{0, nullptr}
|
||||
};
|
||||
@ -189,15 +191,7 @@ QString KeySequence::keyToString(int key)
|
||||
// for keypad keys instead)
|
||||
key &= ~Qt::KeypadModifier;
|
||||
|
||||
// a printable 7 bit character?
|
||||
if (key < 0x80 && key != Qt::Key_Space)
|
||||
return QChar(key & 0x7f).toLower();
|
||||
|
||||
// a function key?
|
||||
if (key >= Qt::Key_F1 && key <= Qt::Key_F35)
|
||||
return QString::fromUtf8("F%1").arg(key - Qt::Key_F1 + 1);
|
||||
|
||||
// a special key?
|
||||
// a special key? (check before printable to handle comma/semicolon)
|
||||
int i = 0;
|
||||
while (keyname[i].name) {
|
||||
if (key == keyname[i].key)
|
||||
@ -205,6 +199,14 @@ QString KeySequence::keyToString(int key)
|
||||
i++;
|
||||
}
|
||||
|
||||
// a printable 7 bit character?
|
||||
if (key < 0x80)
|
||||
return QChar(key & 0x7f).toLower();
|
||||
|
||||
// a function key?
|
||||
if (key >= Qt::Key_F1 && key <= Qt::Key_F35)
|
||||
return QString::fromUtf8("F%1").arg(key - Qt::Key_F1 + 1);
|
||||
|
||||
// representable in ucs2?
|
||||
if (key < 0x10000) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
||||
|
||||
Reference in New Issue
Block a user