Skip to content

Commit

Permalink
Ignore Steam Controllers in the Linux driver if HIDAPI is handling them
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 14, 2024
1 parent 7959b08 commit fe3566c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/joystick/linux/SDL_sysjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ static bool IsVirtualJoystick(Uint16 vendor, Uint16 product, Uint16 version, con
}
return false;
}
#else
static bool IsVirtualJoystick(Uint16 vendor, Uint16 product, Uint16 version, const char *name)
{
return false;
}
#endif // SDL_JOYSTICK_HIDAPI

static bool GetSteamVirtualGamepadSlot(int fd, int *slot)
Expand Down Expand Up @@ -661,9 +666,13 @@ static void HandlePendingRemovals(void)

static bool SteamControllerConnectedCallback(const char *name, SDL_GUID guid, SDL_JoystickID *device_instance)
{
SDL_joylist_item *item;
Uint16 vendor, product, version;
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, &version, NULL);
if (SDL_JoystickHandledByAnotherDriver(&SDL_LINUX_JoystickDriver, vendor, product, version, name)) {
return false;
}

item = (SDL_joylist_item *)SDL_calloc(1, sizeof(SDL_joylist_item));
SDL_joylist_item *item = (SDL_joylist_item *)SDL_calloc(1, sizeof(SDL_joylist_item));
if (!item) {
return false;
}
Expand Down

0 comments on commit fe3566c

Please sign in to comment.