Skip to content

Commit 09dfa86

Browse files
committed
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.
1 parent a6d32c9 commit 09dfa86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/qt/askpassphrasedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ bool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)
235235
if (str.length() != 0) {
236236
const QChar *psz = str.unicode();
237237
bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;
238-
if ((fShift && psz->isLower()) || (!fShift && psz->isUpper())) {
238+
if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {
239239
fCapsLock = true;
240240
ui->capsLabel->setText(tr("Warning: The Caps Lock key is on!"));
241241
} else if (psz->isLetter()) {

0 commit comments

Comments
 (0)