Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HID Devices and raw input

505 views
Skip to first unread message

memory_leak

unread,
Feb 16, 2008, 6:02:01 PM2/16/08
to
Hi, this is my first post here, and I really hope I have got to right place
to ask this question.

I am trying to read some gamepad input with raw input api. I can receive
inputs from the mouse, keyboard and gamepad and while mouse and keyboard are
well sorted, the "RIM_TYPEHID" devices like gamepad seems to be just a binary
blobb (hid.bRawInput). I have played around a bit with those 9 bytes I got in
input and I can see that every byte stand for another button, but there seems
to be 3 buttons that don't give any output. Also when checking device class,
the gamepad is registering rather as a joystick rather then gamepad (usage 4,
should be 5 instead). When checking device in control panel there seems not
to be problems, every button is recognized (but then control panel applet is
developed by manufacturer so they now how to do it :)).

I wonder how can I find out how to interpret the input part? I have been
quuuuuiiite a lot on msdn library but I found docs a bit short on examples.

I guess I should use HidP_GetButtonCaps, and that data I am interesting in
is in HIDP_BUTTON_CAPS among other structs, but I am not really sure how to
use it. I don't really get what I want, so after several attempts (and days)
I have to ask here if someone can clear things up a bit?

This is my first attempt at reading hid devices, and there seems not to be
many examples on the google neither; Everyone seem to be into reading two
mice or keyboards with c# or basic .... nothing about gampads and/or joystics
:(

By the way my gamepad is saiteks analog fps somethign, and I plan to use two
of them at same time for a game I am developing. Yes I have heard of dinput,
but I want to do it all by myself for the sport of doing it, and it anyway it
seems like you can have only one logical gamepad in dinput anyway, though I
am not sure how things look like in new xinput api; maybe they support
several pads at once, I don't know, I have not tryed it yet.

thnks for help in advance

Owen Smith

unread,
Feb 18, 2008, 4:31:39 AM2/18/08
to
Try using HidP_GetButtons() to retrieve a list of usages that are
currently set (i.e. pressed)

If you have installed the Saitek drivers, then a button will be suppressed
by the driver, and will never be seen pressed by user mode code (its used
by the programming software as a shift button)

XInput will only work with X-Box360 compatible pads, which doesnt include
the Saitek pad.
DirectInput can support multiple controllers, but all the examples I can
find stop the enumeration after finding the first joystick.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Doron Holan [MSFT]

unread,
Feb 18, 2008, 4:47:09 PM2/18/08
to
the WDK has examples of how to use the hid.dll apis. you need to use these
apis to parse the data and get it back into a form in which you can use..

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"memory_leak" <memor...@discussions.microsoft.com> wrote in message
news:0ACB6A19-5E7B-4F16...@microsoft.com...

0 new messages