SDL: don't use guid as unique id as it's not unique to a device instance

Issue #74
This commit is contained in:
Flyinghead 2020-04-16 16:17:30 +02:00
parent 2d1c3fa307
commit a9fc78b88e
1 changed files with 2 additions and 7 deletions

View File

@ -52,13 +52,8 @@ public:
{
_name = SDL_JoystickName(sdl_joystick);
sdl_joystick_instance = SDL_JoystickInstanceID(sdl_joystick);
INFO_LOG(INPUT, "SDL: Opened joystick on port %d: '%s'", maple_port, _name.c_str());
SDL_JoystickGUID guid = SDL_JoystickGetGUID(sdl_joystick);
char buf[33];
SDL_JoystickGetGUIDString(guid, buf, sizeof(buf));
_unique_id = buf;
if (_unique_id.empty())
_unique_id = _name;
_unique_id = "sdl_joystick_" + std::to_string(sdl_joystick_instance);
INFO_LOG(INPUT, "SDL: Opened joystick %d on port %d: '%s' unique_id=%s", sdl_joystick_instance, maple_port, _name.c_str(), _unique_id.c_str());
if (!find_mapping())
{