ObjFW  History of src/hid/platform/Linux/OFGameController.m of 4c804d8fa76ca80d

History of file src/hid/platform/Linux/OFGameController.m at check-in 4c804d8fa76ca80d

2024-11-03
15:46
ObjFWHID: Properly hide private methods

Also fixes compiling XInput with GCC. file: [7866e864ec] check-in: [bc3a7747d9] user: js, branch: trunk, size: 11577 [annotate] [blame] [check-ins using] [diff]

2024-10-22
22:29
-[OHGameController {retrieve -> update}State] file: [8882f3e69e] check-in: [23e3ffff7a] user: js, branch: trunk, size: 11423 [annotate] [blame] [check-ins using] [diff]
2024-08-20
22:09
Improve compatibility with old glibc file: [5d84c38c52] check-in: [fb069cf2ae] user: js, branch: trunk, size: 11425 [annotate] [blame] [check-ins using] [diff]
20:44
Improve compatibility with old evdev headers file: [ed0a8b42b6] check-in: [27d64d775a] user: js, branch: trunk, size: 11416 [annotate] [blame] [check-ins using] [diff]
2024-07-04
18:45
Make conformance to OHEvdevMapping private file: [f0e6f8f999] check-in: [146b11b201] user: js, branch: trunk, size: 11390 [annotate] [blame] [check-ins using] [diff]
2024-06-30
12:17
ObjFWHID: Add profiles for Joy-Cons file: [2b74578768] check-in: [96c7c533b1] user: js, branch: trunk, size: 11144 [annotate] [blame] [check-ins using] [diff]
2024-06-18
22:13
ObjFWHID: Add profile for extended N64 controller file: [7e3c50d414] check-in: [cb71b05d78] user: js, branch: trunk, size: 10827 [annotate] [blame] [check-ins using] [diff]
2024-06-17
00:37
ObjFWHID: Make profiles implementation independent file: [758671613d] check-in: [ddaa4f35d0] user: js, branch: trunk, size: 10645 [annotate] [blame] [check-ins using] [diff]
2024-06-09
23:39
Various cleanups file: [548d505db7] check-in: [01f1d066bc] user: js, branch: trunk, size: 19329 [annotate] [blame] [check-ins using] [diff]
15:12
ObjFWHID: Make OHGameControllerProfile a protocol file: [98e64f1a03] check-in: [8be13b6bc6] user: js, branch: trunk, size: 19369 [annotate] [blame] [check-ins using] [diff]
11:43
OHGamepad: Move some elements to OHExtendedGamepad

This allows to have a profile for limited gamepads such as found on the
Nintendo DS rather than only having the raw profile for those. file: [c35ba635a9] check-in: [998339ff24] user: js, branch: trunk, size: 18942 [annotate] [blame] [check-ins using] [diff]

11:17
ObjFWHID: Add OHCombinedJoyCons file: [1aae3bc76f] check-in: [1ba9cce376] user: js, branch: trunk, size: 18836 [annotate] [blame] [check-ins using] [diff]
09:53
OHEvdevGameController: Buttons for N64 controller file: [47295b2089] check-in: [f5e3072b7e] user: js, branch: trunk, size: 18826 [annotate] [blame] [check-ins using] [diff]
02:13
OHEvdevGameController: Add button map for Joy-Cons file: [e96c61a23a] check-in: [081c229439] user: js, branch: trunk, size: 18351 [annotate] [blame] [check-ins using] [diff]
01:59
ObjFWHID: Add support for Stadia controller file: [a742844fc7] check-in: [67c7e7c8ae] user: js, branch: trunk, size: 17626 [annotate] [blame] [check-ins using] [diff]
01:34
ObjFWHID: Add support for DualShock 4 via evdev file: [453f7a0173] check-in: [5fe4c8c1bf] user: js, branch: trunk, size: 16858 [annotate] [blame] [check-ins using] [diff]
2024-06-08
22:47
OHEvdevGameController: Default to Xbox buttons

The vast majority of controllers out there are Xbox 360-compatible
controllers, so let's use those button names by default. file: [c2e9c0c45a] check-in: [6b3b47c1f4] user: js, branch: trunk, size: 16414 [annotate] [blame] [check-ins using] [diff]

22:40
ObjFWHID: Add support for DualSense via evdev file: [34e73fdaa7] check-in: [3d8deae83e] user: js, branch: trunk, size: 16425 [annotate] [blame] [check-ins using] [diff]
2024-06-04
23:51
Add OHGamepad file: [f6abf87a47] check-in: [c45b04b1f8] user: js, branch: trunk, size: 15537 [annotate] [blame] [check-ins using] [diff]
2024-06-03
19:53
Compile OHEvdevGameController separately file: [4aad12f123] check-in: [82da883fa6] user: js, branch: trunk, size: 15329 [annotate] [blame] [check-ins using] [diff]
19:45
Rename OHGameController{Mapping -> Profile} file: [4225244e9f] check-in: [f333689336] user: js, branch: trunk, size: 15320 [annotate] [blame] [check-ins using] [diff]
19:39
Renamed src/hid/HIDEvdevGameController.m → src/hid/OHEvdevGameController.m. ObjFWHID: Change prefix to OH

Let's leave 3 letter prefixes to 3rd parties. file: [a90f4bebdd] check-in: [afae3291bf] user: js, branch: trunk, size: 15304 [annotate] [blame] [check-ins using] [diff]

00:31
Make GCC happy again file: [3e3a114e9f] check-in: [4bee9b1b32] user: js, branch: trunk, size: 15331 [annotate] [blame] [check-ins using] [diff]
2024-06-02
23:51
Add HIDGameControllerMapping file: [3928045f56] check-in: [16aab59c3c] user: js, branch: trunk, size: 15264 [annotate] [blame] [check-ins using] [diff]
21:24
Renamed src/hid/OFEvdevGameController.m → src/hid/HIDEvdevGameController.m. Completely redesign and rewrite ObjFWHID

Right now only evdev is supported, support for others will be added back
later. file: [d527831ab5] check-in: [39639cd987] user: js, branch: trunk, size: 14502 [annotate] [blame] [check-ins using] [diff]

2024-05-22
23:18
OFEvdevGameController: Rotate Joy-Cons

Since both are detected as separate devices, rotate them so that they
can be used as a single device.

A new class will be added to combine two Joy-Cons into one controller. file: [bcc812f365] check-in: [21bcf92ecd] user: js, branch: trunk, size: 22150 [annotate] [blame] [check-ins using] [diff]

2024-05-20
21:48
OFGameController: Improve right stick emulation file: [be8e76e300] check-in: [8c81efc528] user: js, branch: trunk, size: 20779 [annotate] [blame] [check-ins using] [diff]
19:38
OFEvdevGameController: Poll HAT0[XY] for D-Pad file: [9e74768eff] check-in: [f99cb23d38] user: js, branch: trunk, size: 20213 [annotate] [blame] [check-ins using] [diff]
17:29
OFGameController: Fix polling trigger pressure file: [c9d2d02f2c] check-in: [cf17d93f51] user: js, branch: trunk, size: 19384 [annotate] [blame] [check-ins using] [diff]
17:19
OFEvdevGameController: Add support for polling

This is required to get the initial state and when events get dropped. file: [5b6c618a19] check-in: [8e95537be5] user: js, branch: gamecontroller, size: 19393 [annotate] [blame] [check-ins using] [diff]

15:53
OFGameController: No symbols for custom buttons file: [beaad493bb] check-in: [cb4c3d09f4] user: js, branch: gamecontroller, size: 16734 [annotate] [blame] [check-ins using] [diff]
15:48
OFGameController: Clean up buttons a bit

This also emulates a right analog stick using the C buttons on the N64
controller. file: [c33068523f] check-in: [a0af8f40b8] user: js, branch: gamecontroller, size: 16829 [annotate] [blame] [check-ins using] [diff]

01:17
OFGameController: Add support for Wii file: [3ddc2d6279] check-in: [918c9d077a] user: js, branch: gamecontroller, size: 16234 [annotate] [blame] [check-ins using] [diff]
2024-05-18
12:06
OFGameController: Map - to Select and + to Start file: [7e2448fb2d] check-in: [c28b5e5208] user: js, branch: gamecontroller, size: 16284 [annotate] [blame] [check-ins using] [diff]
11:37
OFGameController: More code reuse file: [3197bc7111] check-in: [764fe0bac3] user: js, branch: gamecontroller, size: 16398 [annotate] [blame] [check-ins using] [diff]
2024-05-15
22:50
Renamed src/hid/platform/Linux/OFGameController.m → src/hid/OFEvdevGameController.m. OFGameController: Use different subclasses file: [7d8e2879a0] check-in: [4ecdef7491] user: js, branch: gamecontroller, size: 16523 [annotate] [blame] [check-ins using] [diff]
21:34
OFGameController: Add mapping for DualShock 4 file: [9e75f36cc8] check-in: [13c7749eed] user: js, branch: gamecontroller, size: 16609 [annotate] [blame] [check-ins using] [diff]
20:21
Add insane workarounds for Stadia controller file: [8fba4596f9] check-in: [ae7664ae48] user: js, branch: gamecontroller, size: 16477 [annotate] [blame] [check-ins using] [diff]
19:34
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. file: [3b09a9b74f] check-in: [5fdf28dd29] user: js, branch: gamecontroller, size: 15216 [annotate] [blame] [check-ins using] [diff]

2024-05-14
22:14
OFGameController: Fix Xbox 360 controller mapping

It turns out the quirk for all other controllers to swap north/west was
wrong, and the Xbox 360 controller is actually the one that has
north/west swapped.

The reason for this seems to be that Linux has BTN_NORTH and BTN_X
mapped to the same code, as well as BTN_WEST to BTN_Y. However, on the
Xbox 360 controller, Y is north and X is west. It seems that the Xbox
360 driver decided to return BTN_X and BTN_Y (so that the labels are
correct) while other drivers return BTN_NORTH and BTN_SOUTH (so that the
position is correct). file: [a14fd08793] check-in: [a4fa1b26f2] user: js, branch: gamecontroller, size: 15062 [annotate] [blame] [check-ins using] [diff]

21:39
OFGameController: Fix mapping for Sony DualSense file: [f983d21e94] check-in: [4c804d8fa7] user: js, branch: gamecontroller, size: 14763 [annotate] [blame] [check-ins using] [diff]
21:27
OFGameController: Correctly handle unknown buttons file: [0e451122ed] check-in: [dd18e20cea] user: js, branch: gamecontroller, size: 14406 [annotate] [blame] [check-ins using] [diff]
20:41
OFGameController: Use more generic button names file: [91b0510999] check-in: [2c2412d3df] user: js, branch: gamecontroller, size: 14380 [annotate] [blame] [check-ins using] [diff]
2024-05-13
20:57
Renamed src/platform/Linux/OFGameController.m → src/hid/platform/Linux/OFGameController.m. Move OFGameController into subframework ObjFWHID file: [cec84b63cd] check-in: [f5f12143ce] user: js, branch: gamecontroller, size: 15502 [annotate] [blame] [check-ins using] [diff]
2024-05-11
21:56
OFGameController: {north,south,west,east}Button file: [cec84b63cd] check-in: [59b45e87d1] user: js, branch: gamecontroller, size: 15502 [annotate] [blame] [check-ins using] [diff]
10:19
OFGameController: Add quirks for Joycons file: [a552f91d7e] check-in: [1da303e600] user: js, branch: gamecontroller, size: 14036 [annotate] [blame] [check-ins using] [diff]
10:06
OFGameController: Report vendor ID and product ID file: [8a31fda877] check-in: [c0735ac803] user: js, branch: gamecontroller, size: 13193 [annotate] [blame] [check-ins using] [diff]
2024-05-10
12:58
OFGameController: Quirks for Mega Drive controller file: [3f585adcc6] check-in: [899801a8b8] user: js, branch: gamecontroller, size: 13498 [annotate] [blame] [check-ins using] [diff]
00:27
OFGameController: Add support for Windows

As this is using XInput 1.3, only XInput-compatible devices are supported. file: [fb841c3ea2] check-in: [22f6f258d8] user: js, branch: gamecontroller, size: 13004 [annotate] [blame] [check-ins using] [diff]

2024-05-09
23:41
OFGameController: Retrieve state explicitly

This avoids retrieving it multiple times when reading multiple things. file: [ff55e4dc62] check-in: [0f902d87eb] user: js, branch: gamecontroller, size: 13005 [annotate] [blame] [check-ins using] [diff]

21:23
OFGameController: Fix checking available buttons file: [36b2c982f2] check-in: [90bd76b84d] user: js, branch: gamecontroller, size: 13187 [annotate] [blame] [check-ins using] [diff]
19:46
OFGameController: Support for pressure sensitivity file: [3d4dad17ed] check-in: [336ecd9bdc] user: js, branch: gamecontroller, size: 13567 [annotate] [blame] [check-ins using] [diff]
19:05
OFGameController: Add constants for buttons file: [25579e0c0b] check-in: [f02049612e] user: js, branch: gamecontroller, size: 12485 [annotate] [blame] [check-ins using] [diff]
18:13
OFGameController: Quirks for Xbox 360 controller file: [470c008fba] check-in: [978e3bfb1e] user: js, branch: gamecontroller, size: 11563 [annotate] [blame] [check-ins using] [diff]
18:01
OFGameController: Add quirks for N64 controller file: [c15cf8d62a] check-in: [21c872dbb0] user: js, branch: gamecontroller, size: 11286 [annotate] [blame] [check-ins using] [diff]
17:39
OFGameController: Correctly scale axes on Linux file: [5c8b1cd04f] check-in: [87fa51ae2e] user: js, branch: gamecontroller, size: 10362 [annotate] [blame] [check-ins using] [diff]
15:39
OFGameController: Change API for analog sticks file: [9d006d5b77] check-in: [5547016712] user: js, branch: gamecontroller, size: 9291 [annotate] [blame] [check-ins using] [diff]
15:24
OFGameController: Handle analog triggers on Linux file: [564dd9be04] check-in: [55a1492876] user: js, branch: gamecontroller, size: 9226 [annotate] [blame] [check-ins using] [diff]
15:13
OFGameController: Handle D-Pad via ABS_HAT0[XY] file: [f6f484278c] check-in: [4fc79b14db] user: js, branch: gamecontroller, size: 8795 [annotate] [blame] [check-ins using] [diff]
12:57
Added: OFGameController: Add support for Linux file: [ce46d32b19] check-in: [6f20cdbd5c] user: js, branch: gamecontroller, size: 7858 [annotate] [blame] [check-ins using]