Fun with JUCE mouse events

Captain's Log: Stardate 77563

Shakes fist at JUCE I spent most of today just wrangling with JUCE's mouse events system to get it to behave how I want. There are some really weird details of how mouse events work in JUCE, particularly when one Component is a listener to events from a different (usually child) Component. The main thing that I had to fight with is how mouse wheel events are handled.

For the new PrecisionSlider, obviously the slider and the thumbwheel part need to see mouse wheel events. But for the rest of the pixels, I want mouse wheel events to bubble up, because then the user can use the mouse wheel to scroll the viewport up and down, by moving the mouse over the text column.

I won't go into the ugly details, but getting this to work properly without the mouse wheel getting captured by e.g. the numeric text input box, etc, required some pretty big workarounds of JUCE's mouse listener system. But I did finally get it working how it should work. I also made some visual style improvements to make it easier to read the sliders (though that's something I'm not super focused on right now).


© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal