editor: some variables not appearing as defined in onKeyboard

This commit is contained in:
bordun 2022-04-09 17:16:05 +02:00
parent 8faaf997a1
commit 8c7df3744a
2 changed files with 3 additions and 6 deletions

View file

@ -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

View file

@ -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') {