File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ async function initGreeter(): Promise<void> {
7474 // Add reboot keybind to reboot on ctrl+alt+del
7575 // only when the lock screen is not shown
7676 document . addEventListener ( 'keydown' , ( e ) => {
77+ if ( window . debugKeys ) {
78+ window . ui . setDebugInfo ( `Key pressed: ${ e . code } (${ e . key } )${ e . ctrlKey ? ' + Ctrl' : '' } ${ e . altKey ? ' + Alt' : '' } ${ e . shiftKey ? ' + Shift' : '' } ${ e . metaKey ? ' + Meta' : '' } ` ) ;
79+ }
7780 if ( e . ctrlKey && e . altKey ) { // Special keybinds
7881 switch ( e . key ) {
7982 case 'Delete' : // Ctrl + Alt + Delete = reboot computer
@@ -85,9 +88,9 @@ async function initGreeter(): Promise<void> {
8588 window . ui . overrideExamMode ( ) ;
8689 break ;
8790 case 'd' : // Ctrl + Alt + D = debug keys: show pressed key in debug info
88- window . debugKeys = true ;
89- window . ui . setDebugInfo ( ' Debug keys enabled') ;
90- break ;
91+ window . debugKeys = ( window . debugKeys ) ? false : true ;
92+ window . ui . setDebugInfo ( ` Debug keys: ${ ( window . debugKeys ? ' enabled' : 'disabled' ) } ` ) ;
93+ return ;
9194 }
9295 }
9396 else { // Regular keybinds
@@ -104,9 +107,6 @@ async function initGreeter(): Promise<void> {
104107 break ;
105108 }
106109 }
107- if ( window . debugKeys ) {
108- window . ui . setDebugInfo ( `Key pressed: ${ e . code } (${ e . key } )${ e . ctrlKey ? ' + Ctrl' : '' } ${ e . altKey ? ' + Alt' : '' } ${ e . shiftKey ? ' + Shift' : '' } ${ e . metaKey ? ' + Meta' : '' } ` ) ;
109- }
110110 } ) ;
111111}
112112
You can’t perform that action at this time.
0 commit comments