diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9285f73c..825daf3f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@
- editor
- change keyboard shortcuts for moving widgets (now `mod + arrows`) and navigating in widgets (now `arrows`) to feel more natural with the project tree view.
+- widgets
+ - script: bypass keyboard shortcuts already used by the editor if it is enabled
## 1.9.6
diff --git a/src/client/editor/index.js b/src/client/editor/index.js
index 7342fbbf..b35f16a8 100644
--- a/src/client/editor/index.js
+++ b/src/client/editor/index.js
@@ -209,6 +209,7 @@ class Editor {
for (let c of combos) {
keyboardJS.bind(c, (e)=>{
+ e.catchedByEditor = true
this.handleKeyboard(c, e)
})
}
diff --git a/src/client/widgets/scripts/script.js b/src/client/widgets/scripts/script.js
index d60b131c..34db3990 100644
--- a/src/client/widgets/scripts/script.js
+++ b/src/client/widgets/scripts/script.js
@@ -26,7 +26,10 @@ class Script extends Widget {
_separator: 'event: keyboard',
- keyBinding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see KeyboardJS documentation)'},
+ keyBinding: {type: 'string|array', value: '', help: [
+ 'Key combo `string` or `array` of strings (see KeyboardJS documentation).',
+ 'If the editor is enabled, some keys / combos will not work.'
+ ]},
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'},
@@ -145,6 +148,8 @@ class Script extends Widget {
keyboardCallback(e) {
+ if (e.catchedByEditor) return
+
if (e.target && (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'SELECT')) return
if (this.getProp('keyType') !== 'both' && e.type !== this.getProp('keyType')) return