qt: Improve capslock detection on non-us keyboards (issue #1855)
On non-us keyboards you can obtain lower case characters even pressing the SHIFT, this caused false positives.
This commit is contained in:
parent
a6d32c94ab
commit
09dfa86baf
1 changed files with 1 additions and 1 deletions
|
@ -235,7 +235,7 @@ bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
|
||||||
if (str.length() != 0) {
|
if (str.length() != 0) {
|
||||||
const QChar *psz = str.unicode();
|
const QChar *psz = str.unicode();
|
||||||
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
|
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
|
||||||
if ((fShift && psz->isLower()) || (!fShift && psz->isUpper())) {
|
if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {
|
||||||
fCapsLock = true;
|
fCapsLock = true;
|
||||||
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
|
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
|
||||||
} else if (psz->isLetter()) {
|
} else if (psz->isLetter()) {
|
||||||
|
|
Loading…
Reference in a new issue