SFML community forums

Help => General => Topic started by: forrestcupp on August 03, 2009, 11:33:33 pm

Title: mouse wheel from sf::Input
Post by: forrestcupp on August 03, 2009, 11:33:33 pm
Is it possible to get mouse wheel movement from an sf::Input instead of from an sf::Event?  If not, this would be a very useful thing to add.  

I have a class with a function that takes a pointer to my Input, which means it has to be called after the Event loop.  I need to get mouse wheel movement in that function.  I tried passing a pointer to the RenderWindow as a parameter and calling GetEvent.  Since it's after the Event loop, that only works about once every 5 times the wheel is moved.

I'd really rather not have to have a whole separate function just to get wheel movement.  Is there any way around this?
Title: mouse wheel from sf::Input
Post by: Laurent on August 04, 2009, 12:00:46 am
Well, it's wouldn't make sense. The mouse wheel doesn't have a persistent state, it just triggers events and then always goes back to its original state. I can't return a "current value" or something like this.
Title: mouse wheel from sf::Input
Post by: forrestcupp on August 04, 2009, 12:43:44 am
I understand what you're saying.

I found another way to implement what I need to do without using an extra function, so I'll be alright anyway.

Thanks.