editor: attempt to get a consistent key scheme

This commit is contained in:
jean-emmanuel 2018-10-10 23:41:16 +02:00
parent ac36ad6629
commit 9ae6dacabc
3 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ var {updateWidget} = require('./data-workers'),
locales = require('../locales')
var multiSelectKey = (navigator.platform || '').match('Mac') ? 'shiftKey' : 'ctrlKey'
var multiSelectKey = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrlKey'
class ContextMenu {
@ -122,7 +122,7 @@ var handleClick = function(event) {
if (contextMenu.menu && !contextMenu.menu.contains(event.target)) contextMenu.close()
if (!event.detail.ctrlKey && event.type !== 'fast-right-click' && (
if (!event.detail.shiftKey && event.type !== 'fast-right-click' && (
event.target.classList.contains('ui-resizable-handle') ||
event.target.classList.contains('ui-draggable-handle') ||
event.target.id === 'open-toggle'
@ -149,7 +149,7 @@ var handleClick = function(event) {
// right-click menu
if (event.type !== 'fast-right-click') return
if (!event.detail.ctrlKey && editor.selectedWidgets.length <= 1) {
if (!event.detail.shiftKey && editor.selectedWidgets.length <= 1) {
editor.select(widget, {multi: event.detail[multiSelectKey]})
}

View file

@ -24,7 +24,7 @@ class SelectArea {
}
mousedown(e) {
if (!e.ctrlKey) return
if (!e.shiftKey) return
this.startX = this.curX = e.clientX
this.startY = this.curY = e.clientY
this.down = true