Posted: Wed Nov 18, 2009 8:20 am
Thanks everybody. I wrote my class as you advised:
But function ...Wheel() every time returns 0! Despite I rotate mouse wheel very hard. What's wrong? Where is mistake?
Code: Select all
class MouseWheelReceiver : public IEventReceiver
{
public:
MouseWheelReceiver()
{WhRotor=0;}
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == irr::EET_MOUSE_INPUT_EVENT)
{
if(event.MouseInput.Event == EMIE_MOUSE_WHEEL) WhRotor+=event.MouseInput.Wheel;
}
return false;
}
virtual f32 Wheel()
{ return WhRotor;}
private:
f32 WhRotor;
};