editor: allow interacting with a widget without selecting it by using the middle mouse button or by holding shift+win (shift+cmd on mac).

This commit is contained in:
bordun 2022-07-04 10:55:25 +02:00
parent aa2b9fea08
commit 1b10dc7ca0
4 changed files with 11 additions and 3 deletions

View file

@ -9,6 +9,9 @@
- knob / encoder: `sensitivity` and ctrl+drag gesture preserve `circular` mode behavior
- knob / encoder: `snap` mode now works like `circular` mode except for the touch start event (value can't jump from start to end anymore)
- editor
- allow interacting with a widget without selecting it by using the middle mouse button or by holding shift+win (shift+cmd on mac).
## 1.16.6
- bug fixes

View file

@ -9,6 +9,7 @@ Clicking on a widget, on a tab label or on an item in the project tree selects t
![](../../img/screenshots/editor.png)
To interact with a widget directly without selecting it, either use the middle mouse button or hold ++shift+win++ (++shift+cmd++ on Mac).
## Menu
@ -39,7 +40,7 @@ Selected widget's properties are displayed and can be modified in the inspector.
- Property fields are all multiline (press `shift + enter` for new line).
- Properties are written in JSON, with some flexibility brought by the [JSON5](https://github.com/json5/json5) format. For example, double quotes around object keys are not mandatory.
- Clicking on a property name spawns a help modal window
- Properties are divided into multiple categories that can be toggled with a click. ++alt+"Click"++ on a category closes the other categories before toggling selected category.
- Properties are divided into multiple categories that can be toggled with a click. ++alt+"Click"++ on a category closes the other categories before toggling selected category.
Some properties (for example `onValue`) have a special code editor with syntax hilighting and many keyboard shortcuts (available by clicking on the "Help" button). In this properties, pressing `enter` will not submit pending changes and instead insert a new line at the cursor position (as you would expect in a regular editor). To submit pending changes, press ++ctrl+enter++ (or ++cmd+enter== on Mac) or click outside the editor.

View file

@ -14,7 +14,11 @@ var multiSelectKey = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrl
var handleClick = function(event) {
if (!editor.enabled) return
if (
!editor.enabled ||
event.detail.button === 1 ||
(event.detail.metaKey && event.detail.shiftKey)
) return
if (!event.detail[multiSelectKey] && event.type !== 'fast-right-click' && (
event.target.classList.contains('no-widget-select') ||

View file

@ -25,7 +25,7 @@ class UiSelectArea {
}
mousedown(e) {
if (!e.shiftKey || event.altKey || event.button === 2) return
if (!e.shiftKey || event.altKey || event.button === 2 || (event.shiftKey && event.metaKey)) return
this.startX = this.curX = e.clientX
this.startY = this.curY = e.clientY
this.down = true