ObjFW  Hex Artifact Content

Artifact 5fdf28dd295c10ad048902626ba93b62c4a110535f18e256dfd9a64f91fb82da:

Manifest of check-in [5fdf28dd29] - 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. by js on 2024-05-15 19:34:12.


A hex dump of this file is not available. Please download the raw binary file and generate a hex dump yourself.