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

Author Topic: Can MouseButtonPressed have different x, and y values than previous MouseMoved?  (Read 1991 times)

0 Members and 2 Guests are viewing this topic.

dogunbound

  • Newbie
  • *
  • Posts: 7
    • View Profile
A simple question just reworded:

Is it possible for a MouseButtonPressed event to have different x, and y positions for the mouse's coordinates than the previous MouseMove event?




Answer: Yes

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
The events are fired independently, so we can't/shouldn't make any assumptions.

Just as an example, again not to make any assumptions on the order or relation between the events, you could get the follow event queue:

MouseMoved (x: 10, y: 20)
MouseButtonPressed (x: 11, y: 20)
MouseMoved (x: 11, y: 20)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/