SFML community forums

Help => Window => Topic started by: Zoomulator on September 12, 2011, 01:13:21 pm

Title: Mouse movement, delta position
Post by: Zoomulator 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.
Title: Mouse movement, delta position
Post by: Laurent 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 ;)
Title: Mouse movement, delta position
Post by: omeg 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).
Title: Mouse movement, delta position
Post by: Laurent 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).
Title: Mouse movement, delta position
Post by: omeg 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 (http://www.sfml-dev.org/forum/viewtopic.php?t=5497) 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. ;)
Title: Mouse movement, delta position
Post by: Zoomulator 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