diff --git a/index.html b/index.html index 4214e1d..8128819 100644 --- a/index.html +++ b/index.html @@ -372,7 +372,7 @@ - + @@ -403,7 +403,7 @@ src="js/ui/tool/generic.js?v=3e678e0" type="text/javascript"> - + diff --git a/js/lib/input.js b/js/lib/input.js index 13ca79d..d5f48cf 100644 --- a/js/lib/input.js +++ b/js/lib/input.js @@ -529,9 +529,9 @@ const keyboard = { this.shortcuts[shortcut.key] = []; this.shortcuts[shortcut.key].push({ - ctrl: !!shortcut.ctrl, - alt: !!shortcut.alt, - shift: !!shortcut.shift, + ctrl: shortcut.ctrl, + alt: shortcut.alt, + shift: shortcut.shift, id: guid(), callback, }); @@ -610,11 +610,16 @@ window.onkeydown = (evn) => { if (callbacks) callbacks.forEach((callback) => { - if ( - !!callback.ctrl === evn.ctrlKey && - !!callback.alt === evn.altKey && - !!callback.shift === evn.shiftKey - ) { + let activate = true; + + if (callback.ctrl !== null && !!callback.ctrl !== evn.ctrlKey) + activate = false; + if (callback.shift !== null && !!callback.shift !== evn.shiftKey) + activate = false; + if (callback.alt !== null && !!callback.alt !== evn.altKey) + activate = false; + + if (activate) { evn.preventDefault(); // onshortcut event keyboard.listen.onshortcut.emit({ diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 070ace4..24454bd 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -100,8 +100,9 @@ const _dream = async (endpoint, request) => { var scriptName = document.getElementById("script-name-input").value; var scriptArgs = document.getElementById("script-args-input").value; if (scriptName.trim() != "" && scriptArgs.trim() != "") { - request.script_name = scriptName; - request.script_args = scriptArgs.split(","); + request.script_name = scriptName.trim(); + // This is necessary so types can be properly specified + request.script_args = JSON.parse(scriptArgs.trim() || "[]"); } // Debugging is enabled