Pan using right mouse button

I want to implement pan control using right mouse button. How could this be achieved?

Can I simply trigger Left mouse up down in my right mouse up down?

I think you’ll have to turn off the default controls and set your own, like I described here:

I’m not sure if there’s an easier way to do this. What sort of application are you building that requires this? Is this more of a preference thing?

You could probably dig into the source code and switch those two events (here’s the file where they’re initialized but that involves creating your own modified version of the Cesium source.

I actually want to use one mouse button for pan (which is there for left mouse button by default), and other mouse button to rotate around clicked entity.
I can rotate around using left mouse button with simply this line of code:;

But then I want pan using right mouse button. So I was thinking to trigger/simulate left mouse up/down event using right mouse up/down.

handler.setInputAction(function(movement) {

// Pick a new feature

var pickedFeature = viewer.scene.pick(movement.position);

if (!Cesium.defined(pickedFeature) || typeof(pickedFeature.content) == ‘undefined’) {



scene.screenSpaceCameraController.enableRotate = true;

var x = pickedFeature.content._model._rtcCenter3D.x;

var y = pickedFeature.content._model._rtcCenter3D.y;

var z = pickedFeature.content._model._rtcCenter3D.z;

pickedCenter = Cesium.Cartesian3.fromElements(x, y, z);;

}, Cesium.ScreenSpaceEventType.LEFT_DOWN);