Qt: Add option to pause when controller is disconnected

This commit is contained in:
Stenzek
2024-05-14 15:52:43 +10:00
parent 2b31c08083
commit 18160a8e06
16 changed files with 129 additions and 85 deletions

View File

@ -822,7 +822,9 @@ bool SDLInputSource::CloseDevice(int joystick_index)
if (it == m_controllers.end())
return false;
InputManager::OnInputDeviceDisconnected(fmt::format("SDL-{}", it->player_id));
InputManager::OnInputDeviceDisconnected(
{{.source_type = InputSourceType::SDL, .source_index = static_cast<u32>(it->player_id)}},
fmt::format("SDL-{}", it->player_id));
if (it->haptic)
SDL_HapticClose(it->haptic);