ObjFW  Check-in [5fdf28dd29]

Overview
Comment:OFGameController: Undo the last commit

It seems that just checking for the Xbox 360 controller VID/PID is not
sufficient, as there are a lot of controllers that are compatible with
it, but have a different VID/PID. However, they all use the xpad driver,
which returns BTN_X and BTN_Y, which in the Linux headers are equal to
BTN_NORTH and BTN_WEST - which is incorrect for an Xbox 360 controller.
It seems the Linux kernel is a huge mess where some drivers return what
is written on the button (such as Xbox 360 via the xpad driver, which
returns BTN_X/BTN_Y) and others where they are located (Sony, Nintendo,
which return BTN_NORTH/BTN_WEST). However, since Linux also maps
BTN_X/BTN_NORTH and BTN_Y/BTN_WEST to the same code, it's impossible to
figure out what the driver meant to do.

As grepping the kernel code for BTN_NORTH has revealed that not a lot of
drivers use it and given that most controllers these days are XInput
controllers (which are handled by the xpad driver), it makes more sense
to assume that a controller is an XInput controller and map the Xbox 360
buttons to their locations. It's much easier to keep a list of
controllers with drivers that actually return BTN_NORTH/BTN_WEST instead
of what's written on the button (so far it seems to be only Nintendo and
Sony) than to keep a list of all XInput controllers.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | gamecontroller
Files: files | file ages | folders
SHA3-256: 5fdf28dd295c10ad048902626ba93b62c4a110535f18e256dfd9a64f91fb82da
User & Date: js on 2024-05-15 19:34:12
Other Links: branch diff | manifest | tags
Context
2024-05-15
20:21
Add insane workarounds for Stadia controller check-in: ae7664ae48 user: js tags: gamecontroller
19:34
OFGameController: Undo the last commit check-in: 5fdf28dd29 user: js tags: gamecontroller
2024-05-14
22:14
OFGameController: Fix Xbox 360 controller mapping check-in: a4fa1b26f2 user: js tags: gamecontroller
Changes