# Wheeldelta not working on Firefox

**URL:** <https://forum.babylonjs.com/t/wheeldelta-not-working-on-firefox/1255>\
**Category:** Questions\
**Created:** [February 8, 2019, 1:19pm UTC](https://forum.babylonjs.com/t/wheeldelta-not-working-on-firefox/1255 "2019-02-08T13:19:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Escobar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/escobar/32/2726_2.png) [@Escobar](https://forum.babylonjs.com/u/Escobar)\
**Post date:** [February 8, 2019, 1:19pm UTC](https://forum.babylonjs.com/t/wheeldelta-not-working-on-firefox/1255/1 "2019-02-08T13:19:50Z")

</div>

I have a really common code:

```
case BABYLON.PointerEventTypes.POINTERWHEEL:
var event = pointerInfo.event;
var delta = 0;
if (event.wheelDelta) { 
     delta = event.wheelDelta;
}

```

And it works nice on Chrome but it doesnt in Firefox (event.wheelDelta is undefined)

Any idea on this?

---

<div class="post-metadata">

**Author:** ![aWeirdo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aweirdo/32/52_2.png) [@aWeirdo](https://forum.babylonjs.com/u/aWeirdo)\
**Post date:** [February 8, 2019, 2:03pm UTC](https://forum.babylonjs.com/t/wheeldelta-not-working-on-firefox/1255/2 "2019-02-08T14:03:45Z")

</div>

Hi @Escobar  
Simply because Firefox wants to feel special sometimes 🙂  
We can use event.deltaY instead, as they support that.

Of course, they still want to be weirdos, so value is only +/- 3, other browsers value is around +/-100…  
thus the (event.deltaY \> 0 ? 100 : -100)

```
scene.onPointerObservable.add(function(pointerInfo){
    var event = pointerInfo.event;
    var delta = 0;
    if(event.deltaY !== 0){
        delta = (event.deltaY > 0 ? 100 : -100);
    }
    console.log("DeltaY; Browser Value:", event.deltaY, " Normalized: ", delta);
}, BABYLON.PointerEventTypes.POINTERWHEEL);
```

---

<div class="post-metadata">

**Author:** ![Escobar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/escobar/32/2726_2.png) [@Escobar](https://forum.babylonjs.com/u/Escobar)\
**Post date:** [February 8, 2019, 4:20pm UTC](https://forum.babylonjs.com/t/wheeldelta-not-working-on-firefox/1255/3 "2019-02-08T16:20:24Z")

</div>

Thank you!
