File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
webapp/src/main/webapp/vue-apps/common/js Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -117,16 +117,26 @@ export function addShortcutsListener(chars, listener) {
117
117
chars . forEach ( c => shortcutChars . add ( c ) ) ;
118
118
window . addEventListener ( 'keydown' , e => {
119
119
if ( e . ctrlKey && e . shiftKey && e . key ) {
120
- const c = e ?. key ?. toLowerCase ?. ( ) ;
121
- if ( chars ?. includes ?. ( c ) && shortcutChars . has ( c ) ) {
122
- e . stopPropagation ( ) ;
123
- e . preventDefault ( ) ;
124
- window . setTimeout ( ( ) => {
125
- listener ( e . key ) ;
126
- } , 10 ) ;
127
- }
120
+ execShortcut ( chars , listener , e ) ;
128
121
}
129
122
} ) ;
123
+ window . addEventListener ( 'key-down' , event => {
124
+ const e = event ?. detail ;
125
+ if ( e ?. key ) {
126
+ execShortcut ( chars , listener , e ) ;
127
+ }
128
+ } ) ;
129
+ }
130
+
131
+ export function execShortcut ( chars , listener , e ) {
132
+ const c = e ?. key ?. toLowerCase ?. ( ) ;
133
+ if ( chars ?. includes ?. ( c ) && shortcutChars . has ( c ) ) {
134
+ e ?. stopPropagation ?. ( ) ;
135
+ e ?. preventDefault ?. ( ) ;
136
+ window . setTimeout ( ( ) => {
137
+ listener ( e . key ) ;
138
+ } , 10 ) ;
139
+ }
130
140
}
131
141
132
142
export function removeShortcutsListener ( chars ) {
You can’t perform that action at this time.
0 commit comments