Fix: Allow comma and semicolon in hotkey config (#7130)
This commit is contained in:
parent
938db301f0
commit
e5e53c02b5
1 changed files with 11 additions and 9 deletions
|
|
@ -62,6 +62,8 @@ static const struct
|
||||||
{Qt::Key_Launch0, "AppUser1"},
|
{Qt::Key_Launch0, "AppUser1"},
|
||||||
{Qt::Key_Launch1, "AppUser2"},
|
{Qt::Key_Launch1, "AppUser2"},
|
||||||
{Qt::Key_Select, "Select"},
|
{Qt::Key_Select, "Select"},
|
||||||
|
{Qt::Key_Comma, "Comma"},
|
||||||
|
{Qt::Key_Semicolon, "Semicolon"},
|
||||||
|
|
||||||
{0, nullptr}
|
{0, nullptr}
|
||||||
};
|
};
|
||||||
|
|
@ -189,15 +191,7 @@ QString KeySequence::keyToString(int key)
|
||||||
// for keypad keys instead)
|
// for keypad keys instead)
|
||||||
key &= ~Qt::KeypadModifier;
|
key &= ~Qt::KeypadModifier;
|
||||||
|
|
||||||
// a printable 7 bit character?
|
// a special key? (check before printable to handle comma/semicolon)
|
||||||
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?
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (keyname[i].name) {
|
while (keyname[i].name) {
|
||||||
if (key == keyname[i].key)
|
if (key == keyname[i].key)
|
||||||
|
|
@ -205,6 +199,14 @@ QString KeySequence::keyToString(int key)
|
||||||
i++;
|
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?
|
// representable in ucs2?
|
||||||
if (key < 0x10000) {
|
if (key < 0x10000) {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue