[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: { onPressed: {
if(mouse.button == Qt.LeftButton) if(mouse.button != Qt.MiddleButton && mouse.modifiers == Qt.NoModifier)
selectNode(null) 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 drag.target = draggable // start drag
} }
onReleased: { onReleased: {

View file

@ -70,6 +70,15 @@ Entity {
} }
] ]
}, },
Action {
id: actionShift
inputs: [
ActionInput {
sourceDevice: keyboardSourceDevice
buttons: [Qt.Key_Shift]
}
]
},
Action { Action {
id: actionControl id: actionControl
inputs: [ inputs: [
@ -114,7 +123,7 @@ Entity {
components: [ components: [
FrameAction { FrameAction {
onTriggered: { 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 d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
var tx = axisMX.value * root.translateSpeed * d; var tx = axisMX.value * root.translateSpeed * d;
var ty = axisMY.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 acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onPressed: { onPressed: {
image.forceActiveFocus() 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 drag.target = image // start drag
} }
onReleased: { onReleased: {