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

Author Topic: Real time mouse wheel event  (Read 2090 times)

0 Members and 1 Guest are viewing this topic.

zerrer

  • Newbie
  • *
  • Posts: 9
    • View Profile
Real time mouse wheel event
« on: April 07, 2015, 10:56:41 pm »
Hello,

Is it possible  to detect if mousewheel has been moved up or down in real time ?

thanks

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Real time mouse wheel event
« Reply #1 on: April 07, 2015, 11:01:16 pm »
What do you mean with "real time"?

You can use sf::Event::MouseWheelScrolled (not sf::Event::MouseWheelMoved). Is the latency for event handling really too high?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

zerrer

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Real time mouse wheel event
« Reply #2 on: April 07, 2015, 11:13:00 pm »
What is the difference between sf::Event::MouseWheelScrolled and  sf::Event::MouseWheelMoved ?

By real time I mean outside the pollevent loop, like for example sf::Keyboard::isKeyPressed I can use it everywhere.

But I think my question is stupid because this seems impossible, sorry..

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Real time mouse wheel event
« Reply #3 on: April 07, 2015, 11:39:23 pm »
What is the difference between sf::Event::MouseWheelScrolled and  sf::Event::MouseWheelMoved ?
The latter is deprecated, don't use it anymore.

By real time I mean outside the pollevent loop, like for example sf::Keyboard::isKeyPressed I can use it everywhere.
This is conceptually impossible because real-time input is used to query the current state, and the scroll wheel has none. The event notifies you about a change (hence delta as a difference), not the current state.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything