SFML community forums

General => Feature requests => Topic started by: sirGustav on October 17, 2012, 11:59:25 pm

Title: Option for high precision unsmoothed mouse movement
Post by: sirGustav on October 17, 2012, 11:59:25 pm
Sfml uses WM_MOUSEMOVE (https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L666), there should be a option to switch to/from WM_INPUT.

Msdn explains why (http://msdn.microsoft.com/en-us/library/windows/desktop/ee418864%28v=vs.85%29.aspx):
Quote
WM_MOUSEMOVE applies pointer acceleration (also known as ballistics) to the raw mouse data. //...// WM_MOUSEMOVE is ideal for moving mouse pointers, it is not so good for moving a first-person camera, since the high-definition precision will be lost.

I don't know about the details about other platforms, but I assume there are similar settings to be made.
Title: Re: Option for high precision unsmoothed mouse movement
Post by: eXpl0it3r on October 18, 2012, 12:13:53 am
Just use sf::Mouse and you're not even event depended anymore... ;)
Title: Re: Option for high precision unsmoothed mouse movement
Post by: sirGustav on October 18, 2012, 07:34:53 am
sf::Mouse (https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/InputImpl.cpp#L193) uses GetCursorPos (http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390%28v=vs.85%29.aspx) that is resolution dependent(i.e low precision) and I assume it also is smoothed since it gets the cursor position and not the HID data, so that's no improvement :)
Title: Re: Option for high precision unsmoothed mouse movement
Post by: Laurent on October 18, 2012, 08:09:19 am
Raw input (directly from the device, not filtered/adjusted by the OS) has already been requested before. You should first try to find the corresponding topics, and see what my answer was. There's no corresponding task on the tracker so I probably was against it ;D

It would also be nice to know why you need this feature.
Title: Re: Option for high precision unsmoothed mouse movement
Post by: sirGustav on October 18, 2012, 04:16:33 pm
I did a search and nothing relevant came up. Searching again using the menu search(instead of the search box that I used before) gives me this (http://en.sfml-dev.org/forums/index.php?topic=8436.msg56653#msg56653) and this (http://en.sfml-dev.org/forums/index.php?topic=1876.msg35821#msg35821):
Yes, raw input looks like an important feature (not only for mouse, for keyboard too).

Doesn't look like you are against it :)

Why? Unfiltered high precision input is not enough? ;)
Title: Re: Option for high precision unsmoothed mouse movement
Post by: Laurent on October 18, 2012, 06:21:52 pm
Quote
Doesn't look like you are against it
Ok, then maybe you can create a new task in the tracker which summarizes what you found on the forum.
Title: Re: Option for high precision unsmoothed mouse movement
Post by: sirGustav on October 18, 2012, 09:14:54 pm
Added the issue: https://github.com/SFML/SFML/issues/304

I can only provide arguments for raw mouse movement so my issue only relates to that.