1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Finetune keyboard shortcut management

This commit is contained in:
ralphwetzel 2022-06-30 21:52:16 +02:00
parent 6090a5b274
commit 3726d6fe3b

View File

@ -265,13 +265,18 @@ RED.keyboard = (function() {
if (partialState) { if (partialState) {
partialState = null; partialState = null;
return resolveKeyEvent(evt); return resolveKeyEvent(evt);
} else if (Object.keys(handler).length > 0) {
partialState = handler;
evt.preventDefault();
return null;
} else {
return null;
} }
if (Object.keys(handler).length > 0) {
// check if there's a potential combined handler initiated by this keyCode
for (h in handler) {
if (matchHandlerToEvent(evt,handler[h]) > -1) {
partialState = handler;
evt.preventDefault();
break;
}
}
}
return null;
} else { } else {
var depth = Infinity; var depth = Infinity;
var matchedHandler; var matchedHandler;