Please reintroduce DirectInput to get extra mouse buttons on windows

Hello,
I believe that it was not really a good decision to drop the DirectInput
code from SDL1.2 to SDL2, because now it is definitely impossible to
access more than 5 mouse buttons. I know that here it is Microsoft to
blame, because they made such an inconsisten API that it is possible to
retrieve the nubmer of mouse buttons (dwNumberOfButtons in
RID_DEVICE_INFO_MOUSE), but not their state (events aren’t generated as
WM_* messages, RAWMOUSE contains ulRawButtons but drivers are not
requested to fill it). Yet, I think that this is a big loss in
functionality, because gamers (a big portion of the end users of SDL) do
use fancy mouses with lots of buttons on Windows.

Cheers.

Yet, I think that this is a big loss in functionality, because gamers (a
big portion of the end users of SDL) do use fancy mouses with lots of
buttons on Windows.

Not only gamers, also office people…

Sorry I couldn’t resist :slight_smile:
VittorioOn Wednesday, November 6, 2013, Lorenzo Pistone wrote:

Cheers.


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

I’m not opposed to re-adding it, but dropping DirectInput did solve a bunch
of inconsistencies in mouse and keyboard handling and it seems like
Microsoft has been deprecating the API for a while.

Would it make sense to add just for mice?On Wed, Nov 6, 2013 at 10:34 AM, Lorenzo Pistone wrote:

Hello,
I believe that it was not really a good decision to drop the DirectInput
code from SDL1.2 to SDL2, because now it is definitely impossible to access
more than 5 mouse buttons. I know that here it is Microsoft to blame,
because they made such an inconsisten API that it is possible to retrieve
the nubmer of mouse buttons (dwNumberOfButtons in RID_DEVICE_INFO_MOUSE),
but not their state (events aren’t generated as WM_* messages, RAWMOUSE
contains ulRawButtons but drivers are not requested to fill it). Yet, I
think that this is a big loss in functionality, because gamers (a big
portion of the end users of SDL) do use fancy mouses with lots of buttons
on Windows.

Cheers.


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

I’m not opposed to re-adding it, but dropping DirectInput did solve a
bunch of inconsistencies in mouse and keyboard handling and it seems
like Microsoft has been deprecating the API for a while.

Would it make sense to add just for mice?

DirectInput is deprecated, and can’t be used in Windows Store apps at all.

RAWMOUSE only lists 5 buttons, but I’m curious what happens if you press
a sixth button; does it drop it? Does RID_DEVICE_INFO_MOUSE clamp to 5?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645578(v=vs.85).aspx

Also: do all those “gamer mice” with a thousand buttons just map the
rest of them to keyboard keys? Surely this didn’t require DirectInput,
right?

–ryan.

2013/11/7, Ryan C. Gordon :

Also: do all those “gamer mice” with a thousand buttons just map the
rest of them to keyboard keys? Surely this didn’t require DirectInput,
right?

Pretty sure those just map to keyboard keys or sequences of keys
(heck, they’re usually reprogrammable so you can use your own macros).
Remember, games that support more than 5 buttons are probably near
non-existent (heck, I bet most games can’t cope with more than 3).

buttons on windows
Message-ID: <527BB218.10004 at icculus.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I’m not opposed to re-adding it, but dropping DirectInput did solve a
bunch of inconsistencies in mouse and keyboard handling and it seems
like Microsoft has been deprecating the API for a while.

Would it make sense to add just for mice?

DirectInput is deprecated, and can’t be used in Windows Store apps at all.

RAWMOUSE only lists 5 buttons, but I’m curious what happens if you press
a sixth button; does it drop it? Does RID_DEVICE_INFO_MOUSE clamp to 5?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645578(v=vs.85).aspx

Also: do all those “gamer mice” with a thousand buttons just map the
rest of them to keyboard keys? Surely this didn’t require DirectInput,
right?

–ryan.

What about WM_APPCOMMAND, could that be getting used to pass these
button signals around? If I recall correctly, a lot of these
"infinite-button" mice have internally stored settings that the user
can choose between on the fly. Since this presumably is to allow a
mouse button to be assigned to something that would normally have a
keyboard button assigned to it by programs that were written without
the assumption of such mice, maybe SDL has support for a portion (or
all) of these and we just don’t realize it?

If they don’t map as keyboard keys in some way, then presumably they
get exposed via HID info (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms645549(v=vs.85).aspx
). I don’t know how exactly that would work (haven’t looked at much of
anything HID related), but I assume that it would be a nuisance.

If these things require supporting HID, then I’d suggest just exposing
the raw data via some appropriate SDL event, since there’s no telling
what you might have to deal with otherwise. The things might even
shoot out a copy of their stored settings every time someone connects
to them, for all I know, since I’m pretty sure that USB’s HID specs
include usb drive support. If someone wants support for that, they can
write an extension library, all that SDL should do in such a generic
case is provide hooks for someone else.> Date: Thu, 07 Nov 2013 10:30:32 -0500

From: “Ryan C. Gordon”
To: SDL Development List
Subject: Re: [SDL] Please reintroduce DirectInput to get extra mouse