diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c1b1bc..bb745046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 1.9.7 + +- bug fixes + - issue when resizing widget using keyboard shortcuts + - advanced syntaxes (VAR{}): avoid storing default value as string if it can be parsed as a javascript primitive (boolean, number, etc) + - advanced syntaxes (VAR{}): ignore quotes around variable name + +- 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 + - matrix: removed ambiguous `start` property + - matrix: advanced syntax blocks can be passed to children without being resolved at the matrix\' scope by adding an underscore before the opening bracket + - text: add `soft` mode for the `wrap` property + - input: improve `numeric` mode on iOS + ## 1.9.6 - bug fixes @@ -15,7 +32,7 @@ - switch: add `wrap` property - editor - - display dropdown and checkbox for boolean properties with extra choices + - display dropdown and checkbox for boolean properties with extra choices ## 1.9.5 diff --git a/package.json b/package.json index a5b1dd79..5e1c5b43 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.9.6", + "version": "1.9.7", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/user-interface/editor.md b/resources/docs/docs/user-interface/editor.md index 2be23576..9bcee9c1 100644 --- a/resources/docs/docs/user-interface/editor.md +++ b/resources/docs/docs/user-interface/editor.md @@ -86,14 +86,14 @@ Multiple widgets can be edited at once. | ++ctrl+shift+d++ | Duplicate selected widget and increment id | | ++alt+c+"Drag"++ | Paste selection to position | | ++alt+c+shift+"Drag"++ | Paste selection to dragged position and increment id | - | ++up++
++down++
++left++
++right++ | Move selected widgets (1 grid unit, hold ++shift++ for 5 grid units) | + | ++ctrl+up++
++ctrl+down++
++ctrl+left++
++ctrl+right++ | Move selected widgets (1 grid unit, hold ++shift++ for 5 grid units) | | ++alt+up++
++alt+down++
++alt+left++
++alt+right++ | Resize selected widgets (1 grid unit, hold ++shift++ for 5 grid units) | | ++ctrl+a++ | Select current widget's siblings and itself | | ++ctrl+shift+a++ | Cancel current widget selection | - | ++ctrl+up++ | Select current widget's parent | - | ++ctrl+down++ | Select current widget's first child | - | ++ctrl+right++ | Select current widget's next sibling | - | ++ctrl+left++ | Select current widget's previous sibling | + | ++up++ | Select current widget's previous sibling | + | ++down++ | Select current widget's next sibling | + | ++left++ | Select current widget's parent | + | ++right++ | Select current widget's first child | | ++t++ | Show selected widget in the project tree | | ++"Home"++ | Send selected widget to back | | ++"Page Up"++ | Send selected widget farther | @@ -122,14 +122,14 @@ Multiple widgets can be edited at once. | ++cmd+shift+d++ | Duplicate selected widget and increment id | | ++alt+c+"Drag"++ | Paste selection to position | | ++alt+c+shift+"Drag"++ | Paste selection to dragged position and increment id | - | ++up++
++down++
++left++
++right++ | Move selected widgets (1 grid unit, hold ++shift++ for 5 grid units) | + | ++cmd+up++
++cmd+down++
++cmd+left++
++cmd+right++ | Move selected widgets (1 grid unit, hold ++shift++ for 5 grid units) | | ++alt+up++
++alt+down++
++alt+left++
++alt+right++ | Resize selected widgets (1 grid unit, hold ++shift++ for 5 grid units) | | ++cmd+a++ | Select current widget's siblings and itself | | ++cmd+shift+a++ | Cancel current widget selection | - | ++cmd+up++ | Select current widget's parent | - | ++cmd+down++ | Select current widget's first child | - | ++cmd+right++ | Select current widget's next sibling | - | ++cmd+left++ | Select current widget's previous sibling | + | ++up++ | Select current widget's previous sibling | + | ++down++ | Select current widget's next sibling | + | ++left++ | Select current widget's parent | + | ++right++ | Select current widget's first child | | ++t++ | Show selected widget in the project tree | | ++"Home"++ | Send selected widget to back | | ++"Page Up"++ | Send selected widget farther | diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 6285b24b..b99c3923 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -62,7 +62,7 @@ | --- | --- | --- | --- | |
address#
| `string` | "auto" | OSC address for sending / receiving messages, it must start with a slash (`/`)

By default ("auto"), the widget's id is used: `/widget_id` | |
preArgs#
| `*`|
`array` | "" | A value or array of values that will be prepended to the widget's value in the OSC messages it sends.

Incoming messages must match these to affect by the widget. | - |
typeTags#
| `string` | "" | Defines the osc argument types, one letter per argument (including preArgs)
- If empty, the types are infered automatically from the values (with numbers casted to floats by default)
- If there are more arguments than type letters, the last type is used for the extra arguments

See http://opensoundcontrol.org/spec-1_0 for existing typetags | + |
typeTags#
| `string` | "" | Defines the osc argument types, one letter per argument (including preArgs)
- If empty, the types are infered automatically from the values (with numbers casted to floats by default)
- If there are more arguments than type letters, the last type is used for the extra arguments

See OSC 1.0 specification for existing typetags | |
decimals#
| `integer` | 2 | Defines the number of decimals to send. | |
target#
| `string`|
`array`|
`null` | "" | This defines the targets of the widget's OSC messages
- A `string` or `array` of strings formatted as follow: `ip:port` or `["ip:portA", "ip:portB"]`
- If midi is enabled, targets can be `midi:device_name`
- If no target is set, messages can still be sent if the server has default targets | |
ignoreDefaults#
| `boolean` | false | Set to `true` to ignore the server's default targets | @@ -87,7 +87,7 @@ |
colorTextOn#
| `string` | "auto" | Defines the widget's text color when active. | |
label#
| `string`|
`boolean` | "auto" | Set to `false` to hide completely
- Insert icons using the prefix ^ followed by the icon's name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)
- Icons can be transformed with the following suffixes: `.flip-[horizontal|vertical|both]`, `.rotate-[90|180|270]`, `.spin`, `.pulse`. Example: `^play.flip-horizontal` | |
vertical#
| `boolean` | false | Set to `true` to display the text vertically | - |
wrap#
| `boolean` | false | Set to `true` to wrap long lines automatically. | + |
wrap#
| `boolean`|
`string` | false | Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.

Choices: `false`, `true`, `soft` | === "button" @@ -109,6 +109,7 @@ |
colorTextOn#
| `string` | "auto" | Defines the widget's text color when active. | |
layout#
| `string` | "vertical" | Defines how items should be laid out

Choices: `vertical`, `horizontal`, `grid` | |
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns or a valid value for the css property "grid-template". | + |
wrap#
| `boolean`|
`string` | false | Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.

Choices: `false`, `true`, `soft` | === "switch" @@ -224,7 +225,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | - |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | + |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget

Choices: `false`, `true`, `smart` | === "value" @@ -273,7 +274,7 @@ | property | type |default | description | | --- | --- | --- | --- | | | `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | - | | `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | + | | `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget

Choices: `false`, `true`, `smart` | | | `boolean` | false | Set to `true` to make the modal require a double tap to open instead of a single tap | === "value" @@ -329,11 +330,10 @@ | property | type |default | description | | --- | --- | --- | --- | |
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | - |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | + |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget

Choices: `false`, `true`, `smart` | |
widgetType#
| `string` | "button" | Defines the type of the widgets in the matrix | |
quantity#
| `number` | 4 | Defines the number of widgets in the matrix | - |
start#
| `integer` | 0 | First widget's index | - |
props#
| `object` | \{} | Defines a set of property to override the widgets' defaults.

JS{{}} and #{} blocks in this field are resolved with an extra variable representing each widget's index: `$` (e.g. `#{$}`)

Advanced syntax blocks (@{}, OSC{}, JS{{}} and #{}) are resolved at the matrix' scope (ie @{this.variables} returns the matrix' variables property)

Note: by default, the widgets inherit from the matrix' `id` and osc properties (`id` and `address` are appended with `/$`) | + |
props#
| `object` | \{} | Defines a set of property to override the widgets' defaults.

JS{} and #{} blocks in this field are resolved with an extra variable representing each widget's index: `$` (e.g. `#{$}`)

Advanced syntax blocks (@{}, OSC{}, JS{}, VAR{} and #{}) are resolved at the matrix' scope (ie @{this.variables} returns the matrix' variables property)

Advanced syntax blocks can be passed to children without being resolved at the matrix' scope by adding an underscore before the opening bracket.

Note: unless overridden, children inherit from the matrix' `id` and osc properties (`id` and `address` are appended with `/$`) | === "value" @@ -407,7 +407,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | - |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | + |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget

Choices: `false`, `true`, `smart` | === "value" @@ -444,7 +444,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | - |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | + |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget

Choices: `false`, `true`, `smart` | === "value" @@ -617,7 +617,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
vertical#
| `boolean` | false | Set to `true` to display the text vertically | - |
wrap#
| `boolean` | false | Set to `true` to wrap long lines automatically. | + |
wrap#
| `boolean`|
`string` | false | Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.

Choices: `false`, `true`, `soft` | |
align#
| `string` | "center" | Text alignment.

Choices: `center`, `left`, `right`, `top`, `bottom`, `left top`, `left bottom`, `right top`, `right bottom` | ## Pads @@ -803,7 +803,7 @@ | --- | --- | --- | --- | |
script#
| `script` | "" | Script executed whenever the widget's receives the defined event. See documentation. | |
event#
| `string` | "value" | Define which events trigger the script's execution.

Choices: `value`, `keyboard`, `once` | - |
keyBinding#
| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation) | + |
keyBinding#
| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation).

If the editor is enabled, some keys / combos will not work. | |
keyRepeat#
| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed | |
keyType#
| `string` | "keydown" | Determines which key event trigger the script's execution

Choices: `keydown`, `keyup`, `both` | diff --git a/src/client/editor/index.js b/src/client/editor/index.js index 1df1aa83..530b37ba 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) }) } @@ -330,10 +331,10 @@ class Editor { break - case 'up': - case 'down': - case 'right': - case 'left': + case 'mod + up': + case 'mod + down': + case 'mod + right': + case 'mod + left': if (!this.selectedWidgets.length) return if (this.selectedWidgets[0].props.top === undefined && e.key.match(/Arrow(Up|Down)/)) return @@ -368,33 +369,24 @@ class Editor { } break - case 'mod + up': - case 'mod + down': - case 'mod + right': - case 'mod + left': + case 'up': + case 'down': + case 'right': + case 'left': if (!this.selectedWidgets.length) return var curWidget = this.selectedWidgets[0], toSelect = null - if (e.key === 'ArrowUp' && curWidget.parent !== widgetManager) { + if (e.key === 'ArrowLeft' && curWidget.parent !== widgetManager) { toSelect = curWidget.parent - } else if (e.key === 'ArrowDown') { + } else if (e.key === 'ArrowRight') { - let toSelectList = [...curWidget.children] + toSelect = curWidget.children[0] - if (toSelectList && toSelectList.length) { - toSelectList.sort((a,b) => a.container.offsetLeft>b.container.offsetLeft) - toSelect = toSelectList[0] - if (toSelect.container.classList.contains('not-editable')) { - toSelect = null - } - } - - } - else if((e.key == 'ArrowLeft') || (e.key == 'ArrowRight')){ + } else if((e.key == 'ArrowUp') || (e.key == 'ArrowDown')){ if (curWidget.parent === widgetManager) return @@ -404,7 +396,7 @@ class Editor { toSelectList.sort((a,b) => a.container.offsetLeft > b.container.offsetLeft) var idx = toSelectList.indexOf(curWidget) if (idx >= 0) { - var nextIdx = (idx + (e.key === 'ArrowLeft' ? -1 : 1 ) + toSelectList.length) % toSelectList.length + var nextIdx = (idx + (e.key === 'ArrowUp' ? -1 : 1 ) + toSelectList.length) % toSelectList.length toSelect = toSelectList[nextIdx] } } @@ -828,12 +820,16 @@ class Editor { for (var i = 0; i < this.selectedWidgets.length; i++) { let w = this.selectedWidgets[i], - dW = deltaW * w.container.offsetWidth / this.widgetDragResize.initWidth, - dH = deltaH * w.container.offsetHeight / this.widgetDragResize.initHeight, nW, nH - nW = w.container.offsetWidth + dW - nH = w.container.offsetHeight + dH + if (i === 0 && ui) { + nW = ui.originalSize.width + deltaW + nH = ui.originalSize.height + deltaH + + } else { + nW = w.container.offsetWidth + deltaW + nH = w.container.offsetHeight + deltaH + } if (w.props.width !== undefined && w.parent.getProp('layout') !== 'vertical') { var newWidth = Math.max(nW, GRIDWIDTH) / PXSCALE diff --git a/src/client/ui/ui-dragresize.js b/src/client/ui/ui-dragresize.js index 23a15d18..70c425b4 100644 --- a/src/client/ui/ui-dragresize.js +++ b/src/client/ui/ui-dragresize.js @@ -147,6 +147,11 @@ class UiDragResize extends UiWidget { this.updateRectangle() + this.initLeft = this.left + this.initTop = this.top + this.initWidth = this.width + this.initHeight = this.height + this.widgets[0].parentNode.appendChild(this.container) this.mounted = true diff --git a/src/client/ui/zoom.js b/src/client/ui/zoom.js index 2cdc4566..0d723ce0 100644 --- a/src/client/ui/zoom.js +++ b/src/client/ui/zoom.js @@ -54,7 +54,7 @@ function applylocalZoom() { document.addEventListener('keydown', function(event){ if (event[mod]) { - console.log(event.keyCode) + var z = false if (event.keyCode == 96 || event.keyCode == 48) { PXSCALE = INITIALZOOM diff --git a/src/client/widgets/basics/input.js b/src/client/widgets/basics/input.js index 57186173..db9c5221 100644 --- a/src/client/widgets/basics/input.js +++ b/src/client/widgets/basics/input.js @@ -60,7 +60,11 @@ class Input extends Canvas { this.blur(true) }) - if (this.getProp('numeric')) this.input.type = 'number' + if (this.getProp('numeric')) { + this.input.type = 'number' + this.input.pattern = '[0-9\.]*' + this.input.inputMode = 'decimal' + } var asYouType = this.getProp('asYouType') diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 6491f684..37892089 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -122,7 +122,7 @@ class Widget extends EventEmitter { 'Defines the osc argument types, one letter per argument (including preArgs)', '- If empty, the types are infered automatically from the values (with numbers casted to floats by default)', '- If there are more arguments than type letters, the last type is used for the extra arguments', - 'See http://opensoundcontrol.org/spec-1_0 for existing typetags' + 'See OSC 1.0 specification for existing typetags' ]}, decimals: {type: 'integer', value: 2, help: [ 'Defines the number of decimals to send.', @@ -638,6 +638,18 @@ class Widget extends EventEmitter { return typeof variables[m] === 'string' ? variables[m] : JSON.stringify(variables[m]) })) + if (typeof value === 'string' && isJSON(value)) { + try { + value = JSON.parseFlex(value) + } catch (err) {} + } + + if ( + // remove quotes + (name[0] === '"' && name[name.length - 1] === '"') || + (name[0] === '\'' && name[name.length - 1] === '\'') + ) name = name.slice(1, name.length - 1) + if (!this.variables[name]) { this.variables[name] = {default: value, value: value, propNames: [propName]} @@ -729,7 +741,7 @@ class Widget extends EventEmitter { }) } catch (err) { - this.errorProp(propName, 'JS{{}}', err) + this.errorProp(propName, 'JS{}', err) } try { diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index 0a6a3e09..839b6eb7 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -17,12 +17,12 @@ class Matrix extends Panel { class_specific: { widgetType: {type: 'string', value: 'button', help: 'Defines the type of the widgets in the matrix'}, quantity: {type: 'number', value: 4, help: 'Defines the number of widgets in the matrix'}, - start: {type: 'integer', value: 0, help: 'First widget\'s index'}, props: {type: 'object', value: {}, help: [ 'Defines a set of property to override the widgets\' defaults.', - 'JS{{}} and #{} blocks in this field are resolved with an extra variable representing each widget\'s index: `$` (e.g. `#{$}`)', - 'Advanced syntax blocks (@{}, OSC{}, JS{{}} and #{}) are resolved at the matrix\' scope (ie @{this.variables} returns the matrix\' variables property)', - 'Note: by default, the widgets inherit from the matrix\' `id` and osc properties (`id` and `address` are appended with `/$`)' + 'JS{} and #{} blocks in this field are resolved with an extra variable representing each widget\'s index: `$` (e.g. `#{$}`)', + 'Advanced syntax blocks (@{}, OSC{}, JS{}, VAR{} and #{}) are resolved at the matrix\' scope (ie @{this.variables} returns the matrix\' variables property)', + 'Advanced syntax blocks can be passed to children without being resolved at the matrix\' scope by adding an underscore before the opening bracket.', + 'Note: unless overridden, children inherit from the matrix\' `id` and osc properties (`id` and `address` are appended with `/$`)' ]}, }, style: { @@ -60,19 +60,19 @@ class Matrix extends Panel { - this.start = parseInt(this.getProp('start')) - if (parser.widgets[this.getProp('widgetType')]) { for (let i = 0; i < this.getProp('quantity'); i++) { - var props = this.resolveProp('props', undefined, false, false, false, {'$':i + this.start}) - var data = this.defaultProps(i + this.start) + var props = this.resolveProp('props', undefined, false, false, false, {'$':i}) + var data = this.defaultProps(i) if (typeof props === 'object' && props !== null) { Object.assign(data, props) } + data = JSON.parse(JSON.stringify(data).replace(/(JS|#|OSC|@|VAR)_\{/g, '$1{')) + var widget = parser.parse({ data: data, parentNode: this.widget, @@ -126,12 +126,14 @@ class Matrix extends Panel { for (let i = this.children.length - 1; i >= 0; i--) { - let data = this.resolveProp('props', undefined, false, false, false, {'$': i + this.start}) + let data = this.resolveProp('props', undefined, false, false, false, {'$': i}) if (typeof data !== 'object' || data === null || Array.isArray(data)) { data = {} } + data = JSON.parse(JSON.stringify(data).replace(/(JS|#|OSC|@|VAR)_\{/g, '$1{')) + if (typeof oldPropValue === 'object' && oldPropValue !== null) { // if an overridden default props is removed, set it back to default let overriddenDefaults, @@ -139,7 +141,7 @@ class Matrix extends Panel { for (var k in oldPropValue) { if (data[k] === undefined) { if (Matrix.overriddenDefaults.indexOf(k) !== -1) { - overriddenDefaults = overriddenDefaults || this.defaultProps(i + this.start) + overriddenDefaults = overriddenDefaults || this.defaultProps(i) data[k] = overriddenDefaults[k] } else { widgetDefaults = widgetDefaults || parser.defaults[data.type || this.getProp('widgetType')] diff --git a/src/client/widgets/indicators/text.js b/src/client/widgets/indicators/text.js index e10ad6da..f2f7e8cd 100644 --- a/src/client/widgets/indicators/text.js +++ b/src/client/widgets/indicators/text.js @@ -20,8 +20,8 @@ module.exports = class Text extends StaticProperties(Widget, {bypass: true, inte style: { _separator_text_style: 'Text style', vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'}, - wrap: {type: 'boolean', value: false, help: [ - 'Set to `true` to wrap long lines automatically.', + wrap: {type: 'boolean|string', value: false, choices: [false, true, 'soft'], help: [ + 'Set to `true` to wrap long lines automatically. Set to `soft` to avoid breaking words.', ]}, align: {type: 'string', value: 'center', choices: ['center', 'left', 'right', 'top', 'bottom', 'left top', 'left bottom', 'right top', 'right bottom'], help: 'Text alignment.'}, }, @@ -46,7 +46,7 @@ module.exports = class Text extends StaticProperties(Widget, {bypass: true, inte if (this.getProp('align').includes('top')) this.text.classList.add('top') if (this.getProp('align').includes('bottom')) this.text.classList.add('bottom') if (this.getProp('wrap')) this.text.classList.add('wrap') - + if (this.getProp('wrap') === 'soft') this.text.classList.add('wrap-soft') this.setValue(this.getProp('default')) diff --git a/src/client/widgets/scripts/script.js b/src/client/widgets/scripts/script.js index 071ff271..4bcf4626 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 diff --git a/src/scss/widgets/indicators.scss b/src/scss/widgets/indicators.scss index f88613ef..f6b8a3c2 100644 --- a/src/scss/widgets/indicators.scss +++ b/src/scss/widgets/indicators.scss @@ -85,6 +85,9 @@ white-space: pre-wrap; word-break: break-all; } + &.wrap-soft { + word-break: normal + } &.vertical { transform: rotate(180deg); text-overflow: ellipsis;