[PATCH v2] dinput: Report controllers as gamepads, not joysticks

Roderick Colenbrander thunderbird2k at gmail.com
Fri Apr 19 09:18:27 CDT 2019


On Wed, Apr 17, 2019 at 8:15 AM Andrew Eikum <aeikum at codeweavers.com> wrote:
>
> On Wed, Apr 17, 2019 at 08:09:16AM -0700, Roderick Colenbrander wrote:
> > What happens on traditional joysticks on windows? Are they really setting
> > the gamepad flag on those too? I would have guessed they used some
> > heuristics for setting such flag.
> >
>
> I don't know. I didn't test, and I'm not sure how we could puzzle out
> such a heuristic.
>
> Andrew

Dinput always was in general a thin layer over HID. I had a quick look
over the HID specs again. Most devices use "Generic Desktop Page" in
their report descriptors. There is a different "Usage ID" in there for
gamepad (5), joystick (4) and keyboard (6). See page 26 in
https://usb.org/sites/default/files/documents/hut1_12v2.pdf. This is
what I would say Dinput derives its info from and we should do the
same in case of HID. When not using HID, well then we probably would
need a heuristic. A very rough one being "if device has only 1 stick"
mark it as a joystick, though fancy flight sticks may have more.

Roderick



More information about the wine-devel mailing list