mouseWheelMove() doesn't include horizontal trackpad scroll


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:

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

Have you tried juce::MouseWheelDetails::deltaX?

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");

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.

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

I’m on linux :upside_down_face: