mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 08:56:25 +00:00
[SDL3] Adding input and FFB support for Logitech G29(PS3) on hidapi (#11598)
These changes enable the Logitech G29 wheel to run on hidapi with both SDL_Joystick and SDL_Haptic interfaces. While it is already possible to use the wheel on Linux in WINE + SDL2 thanks to the in-tree evdev driver as well as new-lg4ff, these set of changes allow the G29 to be used with WINE under MacOS and FreeBSD These wheels should also be supported, but I can only test them from G29's compat modes: G27, G25, DFGT, DFP, DFEX Haptic and led support are ported from https://github.com/berarma/new-lg4ff
This commit is contained in:
@@ -2633,7 +2633,11 @@ bool SDL_IsGamepad(SDL_JoystickID instance_id)
|
||||
if (SDL_FindInHashTable(s_gamepadInstanceIDs, (void *)(uintptr_t)instance_id, &value)) {
|
||||
result = (bool)(uintptr_t)value;
|
||||
} else {
|
||||
if (SDL_PrivateGetGamepadMapping(instance_id, true) != NULL) {
|
||||
SDL_JoystickType js_type = SDL_GetJoystickTypeForID(instance_id);
|
||||
if (js_type != SDL_JOYSTICK_TYPE_GAMEPAD && js_type != SDL_JOYSTICK_TYPE_UNKNOWN) {
|
||||
// avoid creating HIDAPI mapping if SDL_Joystick knows it is not a game pad
|
||||
result = false;
|
||||
} else if (SDL_PrivateGetGamepadMapping(instance_id, true) != NULL) {
|
||||
result = true;
|
||||
} else {
|
||||
result = false;
|
||||
|
Reference in New Issue
Block a user