# Enable and disable camera wheel events

**URL:** <https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660>\
**Category:** Questions\
**Tags:** gui, gizmo\
**Created:** [September 8, 2021, 6:22am UTC](https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660 "2021-09-08T06:22:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [September 8, 2021, 6:22am UTC](https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660/1 "2021-09-08T06:22:55Z")

</div>

Hey~all, I previously used GUI.ScrollViewer events to control the disabling and enabling of camera wheel input.  
in line: 83~89.  
pg: [https://playground.babylonjs.com/#HJZBRG#210](https://playground.babylonjs.com/#HJZBRG#210)  
( I’m not sure if this is reasonable, because when you can see that as long as the mouse moves on the panel, it will always call disable input. I don’t know how to judge whether to disable it when enabled )

In my actual use, the panel may appear inside the gizmo, which will make it unavailable. Do you have any good ideas ?  
pg: [https://playground.babylonjs.com/#HJZBRG#212](https://playground.babylonjs.com/#HJZBRG#212)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 8, 2021, 11:46am UTC](https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660/2 "2021-09-08T11:46:43Z")

</div>

Pinging @msDestiny14 - First - this feels like it should be the default behavior, though I must admit I am not sure. Second, it seems like the wheel event is not passed to the scroll view what the gizmo is visible. can you check that?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 8, 2021, 2:45pm UTC](https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660/3 "2021-09-08T14:45:26Z")

</div>

Assigned @msDestiny14 on September 8, 2021, 2:45pm UTC



---

<div class="post-metadata">

**Author:** ![msDestiny14](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/msdestiny14/32/9572_2.png) [@msDestiny14](https://forum.babylonjs.com/u/msDestiny14)\
**Post date:** [September 8, 2021, 4:55pm UTC](https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660/4 "2021-09-08T16:55:47Z")

</div>

Ok!

So for part 1: [https://playground.babylonjs.com/#HJZBRG#213](https://playground.babylonjs.com/#HJZBRG#213)

I changed the line to onPointerMove to onPointerEnter. I think this is more the behavior you want. onPointerMove is once you are already inside the control and moving around. Plus you are now detaching multiple times.

Also if you want the camera to be disabled on the entire panel where the white is included you might have to do some additional steps. First would be moving the onPointerEnter/Outs to the stackPanel. Next you may need to set some sort of flag for the child scroll viewer because entering on that might cause you to be out on the stackPanel? I’m trying to remember if that is the case of if that’s a react feature and not Babylon. Will need to check that. Let me know if you need help and I can take a look.

Part 2: [https://playground.babylonjs.com/#HJZBRG#214](https://playground.babylonjs.com/#HJZBRG#214)  
Really simple. boundingBox.isPickable = false; 🙂

---

<div class="post-metadata">

**Author:** ![msDestiny14](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/msdestiny14/32/9572_2.png) [@msDestiny14](https://forum.babylonjs.com/u/msDestiny14)\
**Post date:** [October 14, 2021, 3:05pm UTC](https://forum.babylonjs.com/t/enable-and-disable-camera-wheel-events/23660/5 "2021-10-14T15:05:35Z")

</div>

Unassigned @msDestiny14 on October 14, 2021, 3:05pm UTC


