Mouse wheel in modal state

gui

#1

Hi guys, I have a slider that is modal for a specific action and I would like to be able to scroll the slider using the scroll wheel while it is modal without hovering over the slider. Is there any way to receive the scroll wheel updates in a component that entered model state even when I’m not hovering over the slider?


#2

You could register a global mouse listener that will be notified of all mouse events that occur using Desktop::addGlobalMouseListener() after your slider enters its modal state and then modify the slider value in the MouseListener::mouseWheelMove() callback.


#3

Thank you, I tried attaching to the main window but other components didn’t receive mouse events in modal ;).