[PATCH] Horizontal wheel support in windows

Hello,
this patch adds support for the horizontal wheel in Windows. It is
shamelessly copied off the vertical wheel code, but I guess that that is
a value added in consistency.
Also, some drivers map mouse buttons to horizontal scroll, whereas
DirectInput would treat them as normal buttons. In this way it is
possible to get back some buttons that were readable in SDL1.2 but
aren’t anymore on SDL2, because the DirectInput driver was dropped.

Cheers.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: windows_horizontal_wheel.patch
Type: text/x-patch
Size: 1600 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131106/d4b8f388/attachment.bin

Patch added, thanks! :)On Wed, Nov 6, 2013 at 10:16 AM, Lorenzo Pistone wrote:

Hello,
this patch adds support for the horizontal wheel in Windows. It is
shamelessly copied off the vertical wheel code, but I guess that that is a
value added in consistency.
Also, some drivers map mouse buttons to horizontal scroll, whereas
DirectInput would treat them as normal buttons. In this way it is possible
to get back some buttons that were readable in SDL1.2 but aren’t anymore on
SDL2, because the DirectInput driver was dropped.

Cheers.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

uh oh, I realized that this patch uses a different SDL_SendMouseWheel
definition that I have here. I attach the right patch now.

P.S.
the different definition I use allows passing an explicit timestamp: SDL
usually cooks the timestamp based on when the event is fetched from the
system queue, but in some cases (I know of Windows, X11 and cocoa), the
native message comes with a timestamp itself, which determines when the
message was added to the queue, so providing a more accurate timing, not
dependent on how often the application pulls the messages. Would that be
of interest?On 11/07/2013 08:35 AM, Sam Lantinga wrote:

Patch added, thanks! :slight_smile:

On Wed, Nov 6, 2013 at 10:16 AM, Lorenzo Pistone <@Lorenzo_Pistone mailto:Lorenzo_Pistone> wrote:

Hello,
this patch adds support for the horizontal wheel in Windows. It is
shamelessly copied off the vertical wheel code, but I guess that
that is a value added in consistency.
Also, some drivers map mouse buttons to horizontal scroll, whereas
DirectInput would treat them as normal buttons. In this way it is
possible to get back some buttons that were readable in SDL1.2 but
aren't anymore on SDL2, because the DirectInput driver was dropped.

Cheers.

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-------------- next part --------------
A non-text attachment was scrubbed…
Name: windows_horizontal_wheel.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131108/49402444/attachment.bin

[…]

the different definition I use allows passing an explicit timestamp: SDL
usually cooks the timestamp based on when the event is fetched from the
system queue, but in some cases (I know of Windows, X11 and cocoa), the
native message comes with a timestamp itself, which determines when the
message was added to the queue, so providing a more accurate timing, not
dependent on how often the application pulls the messages. Would that be of
interest?

Definitely sounds interesting to me! Driver or hardware level
timestamping is definitely desirable whenever available. Some racing
simulators and the like use dedicated threads for more accurate
timestamping on the application level, but that only goes so far
without a realtime OS…On Fri, Nov 8, 2013 at 2:28 PM, Lorenzo Pistone wrote:


//David Olofson - Consultant, Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://consulting.olofson.net http://olofsonarcade.com |
’---------------------------------------------------------------------’