🩹 fix: remap joystick

This commit is contained in:
Helloyunho 2025-07-02 21:33:23 +09:00
parent 2782e0a1f2
commit 285f6fbe23
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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