# How to rotate arcRotateCam with both left and right mouse clicks

**URL:** <https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409>\
**Category:** Questions\
**Created:** [November 3, 2020, 8:45pm UTC](https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409 "2020-11-03T20:45:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![duxfox](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@duxfox](https://forum.babylonjs.com/u/duxfox)\
**Post date:** [November 3, 2020, 8:45pm UTC](https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409/1 "2020-11-03T20:45:04Z")

</div>

I have a game with an arcRotateCam on a mesh. The camera works 99% like I want. However, I can only rotate the camera with left mouse click + drag. I’d like to also rotate the camera with right mouse click + drag (identical to how left click works). I’m sure there’s a really easy way to do this but I can’t figure it out.

my code is pretty much:

```
    const camera = new BABYLON.ArcRotateCamera("camera1", -Math.PI/2, 1.2, 200, position, scene);
    camera.attachControl(canvas, true);

```

Help is greatly appreciated, thanks!!

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 3, 2020, 8:56pm UTC](https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409/2 "2020-11-03T20:56:34Z")

</div>

hello, you will need to add your own input:

> **[Customize Camera Inputs - Babylon.js Documentation](https://doc.babylonjs.com/how_to/customizing_camera_inputs)**

---

<div class="post-metadata">

**Author:** ![duxfox](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@duxfox](https://forum.babylonjs.com/u/duxfox)\
**Post date:** [November 3, 2020, 9:21pm UTC](https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409/3 "2020-11-03T21:21:18Z")

</div>

is there a way to see the implementation of the left click rotate logic? because I dont know how to implement it myself. I see that I can probably use this one: [ArcRotateCameraPointersInput - Babylon.js Documentation](https://doc.babylonjs.com/api/classes/babylon.arcrotatecamerapointersinput) but I’m not sure how to attach it the right way (in other words, the doc doesn’t show how to attach it to the right click mouse). I’m trying this:

```
const rightClickInput = new BABYLON.ArcRotateCameraPointersInput();
rightClickInput.buttons = [3];
camera.inputs.add(rightClickInput);

```

but it doesnt seem to be working

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 3, 2020, 9:44pm UTC](https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409/4 "2020-11-03T21:44:47Z")

</div>

Almost 🙂  
you can do this:

```auto
camera.attachControl(canvas, true, true, 3); // The 3 here indicates that panning will be done with button 3
camera.inputs.attached.pointers.buttons = [0, 2] // we will use button 0 and 2 (left and right) 

```

---

<div class="post-metadata">

**Author:** ![duxfox](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@duxfox](https://forum.babylonjs.com/u/duxfox)\
**Post date:** [November 4, 2020, 1:22am UTC](https://forum.babylonjs.com/t/how-to-rotate-arcrotatecam-with-both-left-and-right-mouse-clicks/15409/5 "2020-11-04T01:22:30Z")

</div>

awesome, thanks. that did it
