# mouseWheelMove() doesn't include horizontal trackpad scroll

**URL:** <https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890>\
**Category:** Linux\
**Created:** [July 10, 2021, 9:22pm UTC](https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890 "2021-07-10T21:22:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnymayhew28](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@johnnymayhew28](https://forum.juce.com/u/johnnymayhew28)\
**Post date:** [July 10, 2021, 9:22pm UTC](https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890/1 "2021-07-10T21:22:14Z")

</div>

Hi,

I’ve found an issue with the `Component::mouseWheelMoved()` method, where it doesn’t register horizontal scrolling using the trackpad. The event is not even sent to that method. I checked this with debugging in my own projects, and also tested in Tracktion Waveform, and horizontal trackpad scrolling doesn’t work there either.

I am running on:

```markdown
Thinkpad P52s
Manjaro Linux
X11 window system
JUCE v6.0.8.

```

I have tested to see if other programs receive the trackpad movements and they work fine, and they also show up in `xev`. Am I doing something wrong or is this a bug in JUCE ?

Thanks \<3

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [July 11, 2021, 8:18am UTC](https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890/2 "2021-07-11T08:18:39Z")

</div>

Have you tried `juce::MouseWheelDetails::deltaX`?

```auto
constexpr auto scrollThreshold = ...;

void mouseWheelMove (const juce::MouseEvent& mouseEvent,
                     const juce::MouseWheelDetails& wheelDetails) override
{
    if (wheelDetails.deltaX > scrollThreshold)
    {
        DBG ("Scroll Right");
    }
    else if (wheelDetails.deltaX < -scrollThreshold)
    {
        DBG ("Scroll Left");
    }
}

```

---

<div class="post-metadata">

**Author:** ![johnnymayhew28](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@johnnymayhew28](https://forum.juce.com/u/johnnymayhew28)\
**Post date:** [July 11, 2021, 5:10pm UTC](https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890/3 "2021-07-11T17:10:15Z")

</div>

Yes, I’ve debugged the `mouseWheelMove()` method to print the `deltaX` for every time it’s called, but it only gets called on vertical scrolls anyway, so the `deltaX` in those cases is just zero.

To be more clear, what I mean is that when scrolling the trackpad horizontally, the `mouseWheelMove()` method does not get triggered at all, so there isn’t even a `deltaX` for me to use.

When testing using `xev`, if i scroll diagonally, the horizontal component of that scrolling shows up as completely separate events than the vertical ones. And in JUCE, it is only the vertical events that show up.

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [July 12, 2021, 8:35am UTC](https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890/4 "2021-07-12T08:35:50Z")

</div>

Ahh I see, perhaps it’s an inconsistency with mac vs windows, the code I shared works as expected on my mac pro.

---

<div class="post-metadata">

**Author:** ![johnnymayhew28](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@johnnymayhew28](https://forum.juce.com/u/johnnymayhew28)\
**Post date:** [July 12, 2021, 2:40pm UTC](https://forum.juce.com/t/mousewheelmove-doesnt-include-horizontal-trackpad-scroll/46890/5 "2021-07-12T14:40:52Z")

</div>

I’m on linux 🙃
