mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
lockscreen: handle backspace and enter key when switching from keypad
This fixes an issue were pressing the backspace or enter key on the keyboard when using the keypad, unexpected results occurred. This also fixes an issue were if only one key is typed from the initial lockscreen view, the backspace key would not actually do anything.
This commit is contained in:
parent
70ec403a55
commit
abb9b963f0
1 changed files with 12 additions and 6 deletions
|
|
@ -73,6 +73,11 @@ Rectangle {
|
|||
|
||||
function keyPress(data) {
|
||||
if (!lockScreenState.waitingForAuth) {
|
||||
if (data === "\x08") { // Handle backspace
|
||||
root.backspace();
|
||||
} else if (data === "\r") { // Handle enter
|
||||
root.enter();
|
||||
} else {
|
||||
root.lockScreenState.resetPinLabel();
|
||||
|
||||
root.previewCharIndex = lockScreenState.password.length;
|
||||
|
|
@ -82,6 +87,7 @@ Rectangle {
|
|||
letterTimer.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: we have to open the virtual keyboard after a certain amount of time or else it will close anyway
|
||||
Timer {
|
||||
|
|
@ -146,8 +152,8 @@ Rectangle {
|
|||
} else if (text.length > 0) { // key enter
|
||||
root.keyPress(text.charAt(text.length - 1));
|
||||
}
|
||||
prevText = text;
|
||||
}
|
||||
prevText = text;
|
||||
externalEdit = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue