Merge pull request #131 from jaysc/fastpan

added shift modifier for faster pan
This commit is contained in:
tobspr 2020-06-14 15:52:38 +02:00 committed by GitHub
commit 840ba60c76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -901,8 +901,12 @@ export class Camera extends BasicSerializableObject {
forceX += 1;
}
this.center.x += moveAmount * forceX * this.root.app.settings.getMovementSpeed();
this.center.y += moveAmount * forceY * this.root.app.settings.getMovementSpeed();
let movementSpeed =
this.root.app.settings.getMovementSpeed() *
(actionMapper.getBinding(KEYMAPPINGS.navigation.mapMoveFaster).isCurrentlyPressed() ? 2 : 1);
this.center.x += moveAmount * forceX * movementSpeed;
this.center.y += moveAmount * forceY * movementSpeed;
}
}
}

View File

@ -33,6 +33,7 @@ export const KEYMAPPINGS = {
mapMoveRight: { keyCode: key("D") },
mapMoveDown: { keyCode: key("S") },
mapMoveLeft: { keyCode: key("A") },
mapMoveFaster: { keyCode: 16 }, //shift
centerMap: { keyCode: 32 }, // SPACE
mapZoomIn: { keyCode: 187, repeated: true }, // "+"

View File

@ -691,6 +691,7 @@ keybindings:
mapMoveRight: Move Right
mapMoveDown: Move Down
mapMoveLeft: Move Left
mapMoveFaster: Move Faster
centerMap: Center Map
mapZoomIn: Zoom in