script: onKeyboard script not cleaned upon edition / removal

This commit is contained in:
bordun 2022-04-09 17:03:40 +02:00
parent 753a6d5128
commit 8faaf997a1
2 changed files with 5 additions and 3 deletions

View file

@ -4,7 +4,8 @@
- bug fixes
- range: value update issue (internal touch state not updated properly)
- scripting: send(): ignore `ignoreDefaults` property
- scripting: send(): ignore `ignoreDefaults` property
- script: onKeyboard script not cleaned upon edition / removal
## 1.15.7

View file

@ -26,7 +26,8 @@ class ScriptWidget extends Widget {
keyBinding: {type: 'string|array', value: '', help: [
'Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation).',
'If the editor is enabled, some keys / combos will not work.'
'If the editor is enabled, some keys / combos will not work.',
'To process all keystroke events, write `[\'\']`'
]},
keyRepeat: {type: 'boolean', value: true, help: 'Set to `false` to prevent keydown repeats when holding the key combo pressed'},
keyType: {type: 'string', value: 'keydown', choices: ['keydown', 'keyup', 'both'], help: 'Determines which key event trigger the script\'s execution'},
@ -107,7 +108,7 @@ class ScriptWidget extends Widget {
onRemove() {
if (this.getProp('event') === 'keyboard' && this.getProp('keyBinding')) {
if (this.getProp('onKeyboard') && this.getProp('keyBinding')) {
keyboardJS.withContext('global', ()=>{