Skip to content

Commit f215aa5

Browse files
committed
Initial logitech wheel SDL_HIDAPI_DriverLg4ff implementation
Current implementation does not include SDL_Haptic integration for force feedback Supported devices: G29, G27, G25, DFGT, DFP Features: Joystick button, hat and axis input 5 level rev light control on SDL_JoystickSetLED raw hid command sending on SDL_JoystickSendEffect all command sending are based on https://github.com/berarma/new-lg4ff tested on G29 in various compat modes shifter input is not tested because I don't have one
1 parent 7746a96 commit f215aa5

File tree

5 files changed

+829
-1
lines changed

5 files changed

+829
-1
lines changed

Xcode/SDL/SDL.xcodeproj/project.pbxproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 55;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -71,6 +71,7 @@
7171
63134A262A7902FD0021E9A6 /* SDL_pen.c in Sources */ = {isa = PBXBuildFile; fileRef = 63134A242A7902FD0021E9A6 /* SDL_pen.c */; };
7272
75E0915A241EA924004729E1 /* SDL_virtualjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 75E09158241EA924004729E1 /* SDL_virtualjoystick.c */; };
7373
75E09163241EA924004729E1 /* SDL_virtualjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 75E09159241EA924004729E1 /* SDL_virtualjoystick_c.h */; };
74+
89E5801E2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c in Sources */ = {isa = PBXBuildFile; fileRef = 89E5801D2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c */; };
7475
9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */ = {isa = PBXBuildFile; fileRef = 9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */; };
7576
A1626A3E2617006A003F1973 /* SDL_triangle.c in Sources */ = {isa = PBXBuildFile; fileRef = A1626A3D2617006A003F1973 /* SDL_triangle.c */; };
7677
A1626A522617008D003F1973 /* SDL_triangle.h in Headers */ = {isa = PBXBuildFile; fileRef = A1626A512617008C003F1973 /* SDL_triangle.h */; };
@@ -608,6 +609,7 @@
608609
63134A242A7902FD0021E9A6 /* SDL_pen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pen.c; sourceTree = "<group>"; };
609610
75E09158241EA924004729E1 /* SDL_virtualjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_virtualjoystick.c; sourceTree = "<group>"; };
610611
75E09159241EA924004729E1 /* SDL_virtualjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_virtualjoystick_c.h; sourceTree = "<group>"; };
612+
89E5801D2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_lg4ff.c; sourceTree = "<group>"; };
611613
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_shield.c; sourceTree = "<group>"; };
612614
A1626A3D2617006A003F1973 /* SDL_triangle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_triangle.c; sourceTree = "<group>"; };
613615
A1626A512617008C003F1973 /* SDL_triangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_triangle.h; sourceTree = "<group>"; };
@@ -1904,6 +1906,7 @@
19041906
A7D8A7BE23E2513E00DCD162 /* hidapi */ = {
19051907
isa = PBXGroup;
19061908
children = (
1909+
89E5801D2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c */,
19071910
F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */,
19081911
A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */,
19091912
F3F07D59269640160074468B /* SDL_hidapi_luna.c */,
@@ -2966,6 +2969,7 @@
29662969
A7D8B76423E2514300DCD162 /* SDL_mixer.c in Sources */,
29672970
A7D8BB5723E2514500DCD162 /* SDL_events.c in Sources */,
29682971
A7D8ADE623E2514100DCD162 /* SDL_blit_0.c in Sources */,
2972+
89E5801E2D03602200DAF6D3 /* SDL_hidapi_lg4ff.c in Sources */,
29692973
A7D8B8A823E2514400DCD162 /* SDL_diskaudio.c in Sources */,
29702974
56A2373329F9C113003CCA5F /* SDL_sysrwlock.c in Sources */,
29712975
F3A9AE9A2C8A13C100AAC390 /* SDL_shaders_gpu.c in Sources */,

include/SDL3/SDL_hints.h

+13
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,19 @@ extern "C" {
17231723
*/
17241724
#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI "SDL_JOYSTICK_HIDAPI_STEAM_HORI"
17251725

1726+
/**
1727+
* A variable controlling whether the HIDAPI driver for some Logitech wheels
1728+
* should be used.
1729+
*
1730+
* This variable can be set to the following values:
1731+
*
1732+
* - "0": HIDAPI driver is not used
1733+
* - "1": HIDAPI driver is used
1734+
*
1735+
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
1736+
*/
1737+
#define SDL_HINT_JOYSTICK_HIDAPI_LG4FF "SDL_JOYSTICK_HIDAPI_LG4FF"
1738+
17261739
/**
17271740
* A variable controlling whether the HIDAPI driver for Nintendo Switch
17281741
* controllers should be used.

0 commit comments

Comments
 (0)