From 285f6fbe233abb58d6c6d7efff00f5d946206e4d Mon Sep 17 00:00:00 2001 From: Helloyunho Date: Wed, 2 Jul 2025 21:33:23 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20fix:=20remap=20joystick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ISLE/isleapp.cpp | 1 - LEGO1/lego/legoomni/src/input/legoinputmanager.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index b042c683..373ea881 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -500,7 +500,6 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event) g_lastJoystickMouseY = -((float) event->gaxis.value) / SDL_JOYSTICK_AXIS_MAX * 4; } else if (event->gaxis.axis == SDL_XBOX_AXIS_RIGHT_TRIGGER) { - SDL_Log("Right trigger axis motion: %d", event->gaxis.value); if (event->gaxis.value != SDL_JOYSTICK_AXIS_MIN) { g_mousedown = TRUE; diff --git a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp index a70b43f5..08c40da1 100644 --- a/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp +++ b/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp @@ -189,8 +189,13 @@ MxResult LegoInputManager::GetJoystickState(MxU32* p_joystickX, MxU32* p_joystic return FAILURE; } +#ifdef WINDOWS_STORE + MxS16 xPos = SDL_GetJoystickAxis(m_joystick, 1); + MxS16 yPos = -SDL_GetJoystickAxis(m_joystick, 0); +#else MxS16 xPos = SDL_GetJoystickAxis(m_joystick, 0); MxS16 yPos = SDL_GetJoystickAxis(m_joystick, 1); +#endif MxU8 hatPos = SDL_GetJoystickHat(m_joystick, 0); // normalize values acquired from joystick axes