mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-19 21:13:12 -07:00
Show SDL GUID in Controller Name in GUI
This commit is contained in:
parent
d4dc0ffee1
commit
7cf370c70d
1 changed files with 5 additions and 1 deletions
|
@ -251,7 +251,11 @@ QString Controller::GetName()
|
||||||
#ifdef CHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER
|
#ifdef CHIAKI_GUI_ENABLE_SDL_GAMECONTROLLER
|
||||||
if(!controller)
|
if(!controller)
|
||||||
return QString();
|
return QString();
|
||||||
return SDL_GameControllerName(controller);
|
SDL_Joystick *js = SDL_GameControllerGetJoystick(controller);
|
||||||
|
SDL_JoystickGUID guid = SDL_JoystickGetGUID(js);
|
||||||
|
char guid_str[256];
|
||||||
|
SDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str));
|
||||||
|
return QString("%1 (%2)").arg(SDL_JoystickName(js), guid_str);
|
||||||
#else
|
#else
|
||||||
return QString();
|
return QString();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue