mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user