Keybinds.js: factorize keybind detection & display logic

LockScreen: remove hardcoded Keybinds
Launcher: remove most hardcoded keybinds (except for Tab etc)
MainScreen: remove most hardcoded keybinds (except for Home etc)
SessionMenu: remove all hardcoded keybinds
WallpaperPanel: remove all hardcoded keybinds
This commit is contained in:
Lysec
2026-02-11 10:09:51 +01:00
parent 17138ca7c0
commit 9a20838904
8 changed files with 191 additions and 352 deletions
+3 -2
View File
@@ -11,6 +11,7 @@ import qs.Services.Keyboard
import qs.Services.Media
import qs.Services.UI
import qs.Widgets
import "../../Helpers/Keybinds.js" as Keybinds
Loader {
id: root
@@ -278,11 +279,11 @@ Loader {
onTextChanged: lockContext.currentText = text
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
if (Keybinds.checkKey(event, 'enter', Settings)) {
lockContext.tryUnlock();
event.accepted = true;
}
if (event.key === Qt.Key_Escape && panelComponent.timerActive) {
if (Keybinds.checkKey(event, 'escape', Settings) && panelComponent.timerActive) {
panelComponent.cancelTimer();
event.accepted = true;
}