# Trigger/Simulate left mouse using right mouse

**URL:** <https://community.cesium.com/t/trigger-simulate-left-mouse-using-right-mouse/7656>\
**Category:** CesiumJS\
**Created:** [November 4, 2018, 9:14am UTC](https://community.cesium.com/t/trigger-simulate-left-mouse-using-right-mouse/7656 "2018-11-04T09:14:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umar\_Sharif](https://avatars.discourse-cdn.com/v4/letter/u/bcef8e/32.png) [@Umar\_Sharif](https://community.cesium.com/u/Umar_Sharif)\
**Post date:** [November 4, 2018, 9:14am UTC](https://community.cesium.com/t/trigger-simulate-left-mouse-using-right-mouse/7656/1 "2018-11-04T09:14:25Z")

</div>

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: viewer.camera.lookAt(pickedCenter);

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. How can I trigger/simulate left mouse up/down 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’) {

return;

}

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);

viewer.camera.lookAt(pickedCenter);

}, Cesium.ScreenSpaceEventType.LEFT\_DOWN);
