[ui] use shift to pan (instead of Ctrl)

This commit is contained in:
Fabien Castan 2018-07-28 12:04:28 +02:00 committed by Yann Lanthony
parent 9bd70ed8ac
commit 44e34d7eb3
3 changed files with 13 additions and 4 deletions

View file

@ -94,10 +94,10 @@ Item {
}
onPressed: {
if(mouse.button == Qt.LeftButton)
if(mouse.button != Qt.MiddleButton && mouse.modifiers == Qt.NoModifier)
selectNode(null)
if(mouse.button == Qt.MiddleButton || (mouse.button & Qt.LeftButton && mouse.modifiers & Qt.ControlModifier))
if(mouse.button == Qt.MiddleButton || (mouse.button & Qt.LeftButton && mouse.modifiers & Qt.ShiftModifier))
drag.target = draggable // start drag
}
onReleased: {

View file

@ -70,6 +70,15 @@ Entity {
}
]
},
Action {
id: actionShift
inputs: [
ActionInput {
sourceDevice: keyboardSourceDevice
buttons: [Qt.Key_Shift]
}
]
},
Action {
id: actionControl
inputs: [
@ -114,7 +123,7 @@ Entity {
components: [
FrameAction {
onTriggered: {
if(actionMMB.active || (actionLMB.active && actionControl.active)) { // translate
if(actionMMB.active || (actionLMB.active && actionShift.active)) { // translate
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
var tx = axisMX.value * root.translateSpeed * d;
var ty = axisMY.value * root.translateSpeed * d;

View file

@ -93,7 +93,7 @@ FocusScope {
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onPressed: {
image.forceActiveFocus()
if(mouse.button & Qt.MiddleButton || (mouse.button & Qt.LeftButton && mouse.modifiers & Qt.ControlModifier))
if(mouse.button & Qt.MiddleButton || (mouse.button & Qt.LeftButton && mouse.modifiers & Qt.ShiftModifier))
drag.target = image // start drag
}
onReleased: {