mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 08:56:25 +00:00
Reset enhanced mode state when closing a controller
Fixes https://github.com/libsdl-org/SDL/issues/11912
This commit is contained in:
@@ -1353,6 +1353,10 @@ static void HIDAPI_DriverPS4_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joysti
|
|||||||
SDL_PS4EnhancedReportsChanged, ctx);
|
SDL_PS4EnhancedReportsChanged, ctx);
|
||||||
|
|
||||||
ctx->joystick = NULL;
|
ctx->joystick = NULL;
|
||||||
|
|
||||||
|
ctx->report_sensors = false;
|
||||||
|
ctx->enhanced_mode = false;
|
||||||
|
ctx->enhanced_mode_available = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HIDAPI_DriverPS4_FreeDevice(SDL_HIDAPI_Device *device)
|
static void HIDAPI_DriverPS4_FreeDevice(SDL_HIDAPI_Device *device)
|
||||||
|
@@ -1587,6 +1587,10 @@ static void HIDAPI_DriverPS5_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joysti
|
|||||||
SDL_PS5PlayerLEDHintChanged, ctx);
|
SDL_PS5PlayerLEDHintChanged, ctx);
|
||||||
|
|
||||||
ctx->joystick = NULL;
|
ctx->joystick = NULL;
|
||||||
|
|
||||||
|
ctx->report_sensors = false;
|
||||||
|
ctx->enhanced_mode = false;
|
||||||
|
ctx->enhanced_mode_available = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HIDAPI_DriverPS5_FreeDevice(SDL_HIDAPI_Device *device)
|
static void HIDAPI_DriverPS5_FreeDevice(SDL_HIDAPI_Device *device)
|
||||||
|
@@ -2766,6 +2766,10 @@ static void HIDAPI_DriverSwitch_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joy
|
|||||||
SDL_PlayerLEDHintChanged, ctx);
|
SDL_PlayerLEDHintChanged, ctx);
|
||||||
|
|
||||||
ctx->joystick = NULL;
|
ctx->joystick = NULL;
|
||||||
|
|
||||||
|
ctx->m_bReportSensors = false;
|
||||||
|
ctx->m_bEnhancedMode = false;
|
||||||
|
ctx->m_bEnhancedModeAvailable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void HIDAPI_DriverSwitch_FreeDevice(SDL_HIDAPI_Device *device)
|
static void HIDAPI_DriverSwitch_FreeDevice(SDL_HIDAPI_Device *device)
|
||||||
|
Reference in New Issue
Block a user