From 4de4b1e7a03b91e6cb536be321dc66c73e835374 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 21 Nov 2023 13:23:14 -0800 Subject: [PATCH] Don't tickle PS4 Bluetooth controllers in simple mode The 8BitDo Zero 2 only sends reports when state changes, so trips the disconnected Bluetooth controller detection. The expected use case is that most people will have official PS4 controllers in enhanced report mode, so disconnected Bluetooth controller detection will still work for those. Fixes https://github.com/libsdl-org/SDL/issues/8556 (cherry picked from commit 75df4cc5c2cd6b098f49855437c5262263489eab) --- src/joystick/hidapi/SDL_hidapi_ps4.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c index a03e35eda..a8929dbcb 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c @@ -678,10 +678,14 @@ static void HIDAPI_DriverPS4_TickleBluetooth(SDL_HIDAPI_Device *device) SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data)); } } else { +#if 0 /* The 8BitDo Zero 2 has perfect emulation of a PS4 controllers, except it + * only sends reports when the state changes, so we can't disconnect here. + */ /* We can't even send an invalid effects packet, or it will put the controller in enhanced mode */ if (device->num_joysticks > 0) { HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } +#endif } }