diff --git a/src/client/ui/ui-code-editor.mjs b/src/client/ui/ui-code-editor.mjs index b0f91a5d..8046b637 100644 --- a/src/client/ui/ui-code-editor.mjs +++ b/src/client/ui/ui-code-editor.mjs @@ -207,9 +207,7 @@ class CodeEditor { if (this.language === 'javascript') { let globals = {} - for (var k in scriptGlobals) { - globals[k] = true - } + if (this.name === 'onKeyboard') { globals = {type: true, key: true, code: true, ctrl: true, shift: true, alt: true, meta: true} } else if (this.name === 'onCreate') { @@ -226,6 +224,9 @@ class CodeEditor { globals = {value: true, height: true, width: true, cssVars: true} } + for (var k in scriptGlobals) { + globals[k] = true + } globals.locals = true globals.console = true