Implementing joystick ids in DirectInput

Lucas Zawacki lfzawacki at gmail.com
Mon May 28 13:53:12 CDT 2012


Hey guys, asking for a little code review here...

I was looking at the solution for this bug
http://bugs.winehq.org/show_bug.cgi?id=30705 and it comes down to
implementing the DIPROP_JOYSTICKSID property for joystick devices.
After some research on what this is I know it's always a number
between (0,n), where n is the number of joysticks connected, and is
analogous to the winmm driver joystick id.

The solution I came up is in the attached patch, it's a little weird
but I found it hard to give a unique ID to each joystick on Linux when
they can come from different drivers. This solution uses the order
which dinput puts the joysticks on it's device list and will work
regardless. If someone has a better way to do it I'd like to know.

Cheers,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dinput-Implement-GetProperty-for-JOYSTICKID.patch
Type: application/octet-stream
Size: 2062 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120528/ccdb1196/attachment.obj>


More information about the wine-devel mailing list