# orbitControl() disabling and enabling options

**URL:** https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665
**Category:** Project Guidance
**Created:** [January 10, 2024, 1:42pm UTC](https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665 "2024-01-10T13:42:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elmoNeedsArson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/elmoneedsarson/32/19218_2.png) [@elmoNeedsArson](https://discourse.processing.org/u/elmoNeedsArson)
#### Post date: [January 10, 2024, 1:42pm UTC](https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665/1 "2024-01-10T13:42:46Z")

</div>

When using the built-in orbitControl() function with webGl and p5js you are able to set the strength of the sensitivity in the function (e.g. orbitControl(1,0,1)). This seems to be the only control you get however. Because the left mouse controls rotation around its lookat point, and your right mouse key allows you to pan without rotation. For my game I like the rotation around the lookat point, for which orbitControl is great, but the right mouse button I dislike. Is there a way to disable this somehow? Or is my best option making my own camera with my own controls instead.

---

<div class="post-metadata">

### Author: ![joshua113](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@joshua113](https://discourse.processing.org/u/joshua113)
#### Post date: [December 14, 2024, 1:32am UTC](https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665/2 "2024-12-14T01:32:03Z")

</div>

You can extend or modify the internal behavior of `orbitControl()` to ignore right mouse button interactions. Since `orbitControl` is implemented in the `p5.js` library, you could copy its source code, adapt it, and implement your own version.

The `orbitControl` source is available on the [p5.js GitHub repositor](https://github.com/processing/p5.js/blob/main/src/webgl/p5.Camera.js)[y](https://narysujemy.pl/). Search for `orbitControl()` in `p5.Camera.js` to see how it works and tailor the functionality

---

<div class="post-metadata">

### Author: ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)
#### Post date: [December 14, 2024, 10:38am UTC](https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665/3 "2024-12-14T10:38:43Z")

</div>

Hi,  
why not just thinking simple !?

```auto
function orbitControlJustLeftButton() {
   // remove Wheel actions
   this._setProperty('_pmouseWheelDeltaY', 0);
   this._setProperty('_mouseWheelDeltaY', 0);  
   // Just apply orbitControl on Left Button Actions
   if (mouseButton == LEFT)
      orbitControl();  
}

function draw() {
   // ...
   orbitControlJustLeftButton();
   // ...
}

```

Cheers  
— mnse
