diff --git a/CHANGELOG.md b/CHANGELOG.md index cc511b87..b2a9cfe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - range: value update issue (internal touch state not updated properly) - scripting: send(): ignore `ignoreDefaults` property - script: onKeyboard script not cleaned upon edition / removal + - editor: some variables not appearing as defined in `onKeyboard` ## 1.15.7 diff --git a/src/client/ui/ui-code-editor.js b/src/client/ui/ui-code-editor.js index d39c39aa..a634bdd9 100644 --- a/src/client/ui/ui-code-editor.js +++ b/src/client/ui/ui-code-editor.js @@ -166,12 +166,8 @@ class CodeEditor { if (this.language === 'javascript') { let globals = {} - if (this.name === 'onEvent') { - if (this.widget.getProp('event') === 'value') { - globals = {id: true, value: true, touch: true} - } else if (this.widget.getProp('event') === 'keyboard') { - globals = {type: true, key: true, code: true, ctrl: true, shift: true, alt: true, meta: true} - } + if (this.name === 'onKeyboard') { + globals = {type: true, key: true, code: true, ctrl: true, shift: true, alt: true, meta: true} } else if (this.name === 'onValue') { globals = {id: true, value: true, touch: true} } else if (this.name === 'onDraw') {