From 65562937f3b8e0a29d41cbe0e42c4a2af2bd9606 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 17 Nov 2018 17:10:52 -0800 Subject: [PATCH] Print gamepad GUID string in logs --- app/streaming/input.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/streaming/input.cpp b/app/streaming/input.cpp index ec0eff93..8eca7e54 100644 --- a/app/streaming/input.cpp +++ b/app/streaming/input.cpp @@ -681,12 +681,16 @@ void SdlInputHandler::handleControllerDeviceEvent(SDL_ControllerDeviceEvent* eve state->controller = controller; state->jsId = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(state->controller)); + char guidStr[33]; + SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(SDL_GameControllerGetJoystick(state->controller)), + guidStr, sizeof(guidStr)); name = SDL_GameControllerName(state->controller); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, - "Gamepad %d (player %d) is: %s", + "Gamepad %d (player %d) is: %s (%s)", i, state->index, - name != NULL ? name : ""); + name != NULL ? name : "", + guidStr); // Add this gamepad to the gamepad mask if (m_MultiController) {