mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
🩹 fix: remap joystick
This commit is contained in:
parent
2782e0a1f2
commit
285f6fbe23
@ -500,7 +500,6 @@ SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event)
|
|||||||
g_lastJoystickMouseY = -((float) event->gaxis.value) / SDL_JOYSTICK_AXIS_MAX * 4;
|
g_lastJoystickMouseY = -((float) event->gaxis.value) / SDL_JOYSTICK_AXIS_MAX * 4;
|
||||||
}
|
}
|
||||||
else if (event->gaxis.axis == SDL_XBOX_AXIS_RIGHT_TRIGGER) {
|
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) {
|
if (event->gaxis.value != SDL_JOYSTICK_AXIS_MIN) {
|
||||||
g_mousedown = TRUE;
|
g_mousedown = TRUE;
|
||||||
|
|
||||||
|
|||||||
@ -189,8 +189,13 @@ MxResult LegoInputManager::GetJoystickState(MxU32* p_joystickX, MxU32* p_joystic
|
|||||||
return FAILURE;
|
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 xPos = SDL_GetJoystickAxis(m_joystick, 0);
|
||||||
MxS16 yPos = SDL_GetJoystickAxis(m_joystick, 1);
|
MxS16 yPos = SDL_GetJoystickAxis(m_joystick, 1);
|
||||||
|
#endif
|
||||||
MxU8 hatPos = SDL_GetJoystickHat(m_joystick, 0);
|
MxU8 hatPos = SDL_GetJoystickHat(m_joystick, 0);
|
||||||
|
|
||||||
// normalize values acquired from joystick axes
|
// normalize values acquired from joystick axes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user