diff --git a/CHANGELOG.md b/CHANGELOG.md index 000197b1..718b8380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/resources/docs/docs/user-interface/editor.md b/resources/docs/docs/user-interface/editor.md index 67e4c1fd..0c7cdb18 100644 --- a/resources/docs/docs/user-interface/editor.md +++ b/resources/docs/docs/user-interface/editor.md @@ -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. diff --git a/src/client/editor/context-menu.js b/src/client/editor/context-menu.js index 09d754ec..709e12d3 100644 --- a/src/client/editor/context-menu.js +++ b/src/client/editor/context-menu.js @@ -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') || diff --git a/src/client/ui/ui-selectarea.js b/src/client/ui/ui-selectarea.js index 4a92437f..0fe9eb80 100644 --- a/src/client/ui/ui-selectarea.js +++ b/src/client/ui/ui-selectarea.js @@ -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