Merge branch 'master' of github.com:jean-emmanuel/open-stage-control
This commit is contained in:
commit
cafb8b904a
5 changed files with 10 additions and 11 deletions
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
- 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
|
||||
- editor: some variables not appearing as defined in `onKeyboard`
|
||||
|
||||
## 1.15.7
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "open-stage-control",
|
||||
"productName": "Open Stage Control",
|
||||
"description": "Libre and modular OSC / MIDI controller",
|
||||
"version": "1.15.7",
|
||||
"version": "1.15.8",
|
||||
"author": {
|
||||
"name": "Jean-Emmanuel Doucet",
|
||||
"email": "jean-emmanuel@ammd.net"
|
||||
|
|
|
|||
|
|
@ -917,7 +917,7 @@
|
|||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="script_onKeyboard">onKeyboard<a class="headerlink" href="#script_onKeyboard" title="Permanent link">#</a></h6> | `script` | <code>""</code> | Script executed whenever the widget receives a keyboard event if `keyBinding` is set). See <a href="https://openstagecontrol.ammd.net/docs/widgets/scripting/">documentation</a>. |
|
||||
| <h6 id="script_keyBinding">keyBinding<a class="headerlink" href="#script_keyBinding" title="Permanent link">#</a></h6> | `string`|<br/>`array` | <code>""</code> | Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation).<br/><br/>If the editor is enabled, some keys / combos will not work. |
|
||||
| <h6 id="script_keyBinding">keyBinding<a class="headerlink" href="#script_keyBinding" title="Permanent link">#</a></h6> | `string`|<br/>`array` | <code>""</code> | Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation).<br/><br/>If the editor is enabled, some keys / combos will not work.<br/><br/>To process all keystroke events, write `['']` |
|
||||
| <h6 id="script_keyRepeat">keyRepeat<a class="headerlink" href="#script_keyRepeat" title="Permanent link">#</a></h6> | `boolean` | <code>true</code> | Set to `false` to prevent keydown repeats when holding the key combo pressed |
|
||||
| <h6 id="script_keyType">keyType<a class="headerlink" href="#script_keyType" title="Permanent link">#</a></h6> | `string` | <code>"keydown"</code> | Determines which key event trigger the script's execution<br/><br/>Choices: `keydown`, `keyup`, `both` |
|
||||
|
||||
|
|
|
|||
|
|
@ -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') {
|
||||
|
|
|
|||
|
|
@ -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', ()=>{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue