Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: mouse wheel from sf::Input  (Read 1750 times)

0 Members and 1 Guest are viewing this topic.

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
mouse wheel from sf::Input
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
mouse wheel from sf::Input
« Reply #1 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.
Laurent Gomila - SFML developer

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
mouse wheel from sf::Input
« Reply #2 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.