Irrlicht event for mouse wheel

627 Views Asked by At

I want to get the status for the mouse wheel or get triggered, when the user uses the mouse wheel.

I already have an event receiver like in the example(which is extending from IEventReceiver) but I cannot see / find a way for the mouse wheel.

Is there another receiver / event handler / solution?

2

There are 2 best solutions below

0
On BEST ANSWER
class MyEventReceiver : public IEventReceiver {
    public:
        virtual bool OnEvent(const SEvent& event) {
            if(event.EventType == irr::EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_MOUSE_WHEEL)
                printf("%f\n", event.MouseInput.Wheel);

            return false;
        }
...
0
On

Check the Wheel public attribute of the SMouseInput event type

http://irrlicht.sourceforge.net/docu/structirr_1_1_s_event_1_1_s_mouse_input.html