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

Author Topic: Mouse movement, delta position  (Read 5134 times)

0 Members and 1 Guest are viewing this topic.

Zoomulator

  • Newbie
  • *
  • Posts: 10
    • View Profile
Mouse movement, delta position
« on: September 12, 2011, 01:13:21 pm »
I can't really see the point in not having the delta information kept in the mouse move event. Sure, you can calculate the delta yourself by comparing the new position with the old, but this doesn't work when the mouse position is limited by the screen/window border.

There's a lot of instances where you use the mouse for movement rather than being a cursor. First person look around views, as one example, and there's a few many more.

Besides being limiting by not having it, it's also a question of convenience and clarity. The mouse move event is usually a single instance, and hardly performance intensive, so why not just include the deltas with the mouse move event instead of letting the user hassle with that detail?

I saw an earlier post on the subject, but it had no replies for some reason. Hope this defines the question more clearly.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Mouse movement, delta position
« Reply #1 on: September 12, 2011, 01:31:19 pm »
The mouse delta is not available directly, I would have to use a very different (and possibly complicated) code to retrieve it.

But it's planned, don't worry ;)
Laurent Gomila - SFML developer

omeg

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://omeg.pl/
Mouse movement, delta position
« Reply #2 on: September 12, 2011, 02:04:47 pm »
Plugging in, it would be nice to have "pressed" or "down" field in the mouse/key event args in .NET (indicator whether the button/key was pressed or released).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Mouse movement, delta position
« Reply #3 on: September 12, 2011, 02:17:35 pm »
Quote
Plugging in, it would be nice to have "pressed" or "down" field in the mouse/key event args in .NET (indicator whether the button/key was pressed or released).

In which events exactly? It's useless in the Pressed/Released events, and it's unrelated in others (like MouseMoved).
Laurent Gomila - SFML developer

omeg

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://omeg.pl/
Mouse movement, delta position
« Reply #4 on: September 12, 2011, 02:37:06 pm »
Quote from: "Laurent"
Quote
Plugging in, it would be nice to have "pressed" or "down" field in the mouse/key event args in .NET (indicator whether the button/key was pressed or released).

In which events exactly? It's useless in the Pressed/Released events, and it's unrelated in others (like MouseMoved).

Well, I've added them to MouseButtonEventArgs and KeyEventArgs because I send them to the Gwen.Net input processor which needs to know what is the button/key state. But you're right, I can just encapsulate that in my own struct, I was just lazy. ;)

Zoomulator

  • Newbie
  • *
  • Posts: 10
    • View Profile
Mouse movement, delta position
« Reply #5 on: September 12, 2011, 04:25:46 pm »
Thanks for the reply Laurent.

Don't know if you want to hear it, but maybe SDL got some nice solution for it. It has the delta in its mouse move event, and I reckon it's pretty low level. I don't envy the person who needs to look through SDL source though.

Keep up the good work! Cheers