Don't try to second guess DS4Windows, let it remap things as expected. DS4Windows can create both emulated Xbox and emulated PS4 controllers, and we don't know which the user has it doing, so don't try to second guess it, just let it do it's thing. Users should follow the remapping software recommendations on when to enable/disable it for various situations. Fixes https://github.com/libsdl-org/SDL/issues/6167
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 80d69ca..73c2466 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -2517,39 +2517,6 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid)
return SDL_JOYSTICK_TYPE_UNKNOWN;
}
-static SDL_bool SDL_IsPS4RemapperRunning(void)
-{
-#if defined(__WIN32__) || defined(__WINGDK__)
- const char *mapper_processes[] = {
- "DS4Windows.exe",
- "InputMapper.exe",
- };
- int i;
- PROCESSENTRY32 pe32;
- SDL_bool found = SDL_FALSE;
-
- /* Take a snapshot of all processes in the system */
- HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- if (hProcessSnap != INVALID_HANDLE_VALUE) {
- pe32.dwSize = sizeof(PROCESSENTRY32);
- if (Process32First(hProcessSnap, &pe32)) {
- do
- {
- for (i = 0; i < SDL_arraysize(mapper_processes); ++i) {
- if (SDL_strcasecmp(pe32.szExeFile, mapper_processes[i]) == 0) {
- found = SDL_TRUE;
- }
- }
- } while (Process32Next(hProcessSnap, &pe32) && !found);
- }
- CloseHandle(hProcessSnap);
- }
- return found;
-#else
- return SDL_FALSE;
-#endif
-}
-
SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
{
/* This list is taken from:
@@ -2678,7 +2645,6 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
Uint32 id;
Uint16 vendor;
Uint16 product;
- SDL_GameControllerType type;
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL);
@@ -2697,11 +2663,6 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid)
}
}
- type = SDL_GetJoystickGameControllerTypeFromVIDPID(vendor, product, name, SDL_FALSE);
- if ((type == SDL_CONTROLLER_TYPE_PS4 || type == SDL_CONTROLLER_TYPE_PS5) && SDL_IsPS4RemapperRunning()) {
- return SDL_TRUE;
- }
-
if (SDL_ShouldIgnoreGameController(name, guid)) {
return SDL_TRUE;
}