mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 04:11:36 +00:00
added SDL's GameController naming convention as Fallback
If EInputDeviceExplicit doesn't recognize a specific Controller Type or Device: it'll fallback to SDL's naming conventions. This helps troubleshooting Controller-related issues when using the debug console.
This commit is contained in:
parent
d95aad2b63
commit
22b2ba8fe8
1 changed files with 13 additions and 1 deletions
|
|
@ -183,14 +183,26 @@ static void SetControllerInputDevice(Controller* controller)
|
|||
|
||||
auto controllerType = (hid::EInputDeviceExplicit)controller->GetControllerType();
|
||||
|
||||
// Only proceed if the controller type changes
|
||||
if (hid::g_inputDeviceExplicit != controllerType)
|
||||
{
|
||||
hid::g_inputDeviceExplicit = controllerType;
|
||||
|
||||
LOGFN("Detected controller: {}", hid::GetInputDeviceName());
|
||||
// Handle Unknown Type specifically
|
||||
if (controllerType == hid::EInputDeviceExplicit::Unknown)
|
||||
{
|
||||
const char* controllerName = SDL_GameControllerName(controller->controller);
|
||||
LOGFN("Controller connected: {} (Unknown Controller Type)", controllerName ? controllerName : "Unknown Device");
|
||||
}
|
||||
else
|
||||
{
|
||||
// For known types, only use the EInputDeviceExplicit name
|
||||
LOGFN("Controller connected: {}", hid::GetInputDeviceName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void SetControllerTimeOfDayLED(Controller& controller, bool isNight)
|
||||
{
|
||||
auto r = isNight ? 22 : 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue