fix: checking for touchpad on all controllers

This commit is contained in:
2026-09-17 19:13:52 -04:00
parent f85bdd8a45
commit 570752a7a5
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ SOFTWARE.
*/
#include "INP_ForceFeedback.h"
#include "INP_Main.h"
void CForceFeedback::Initialise(int iInputStateC, unsigned char ucMapC, unsigned char ucActionC, unsigned char ucMenuActionC)
{
@@ -109,7 +110,7 @@ void CForceFeedback::Tick(void)
while (pRumbleNode)
{
RUMBLE_EFFECT *pRumble = pRumbleNode->GetDataAs<RUMBLE_EFFECT>();
SDL_Gamepad* m_pGamepad = SDL_GetGamepadFromPlayerIndex(pRumble->m_Pad);
SDL_Gamepad* m_pGamepad = InternalInputManager.m_Joypads[pRumble->m_Pad].m_pGamepad;
if (pRumble->m_TimeLeft <= qwCurrentTime.QuadPart)
{
+6 -2
View File
@@ -148,9 +148,13 @@ void CInput::SetJoypadValues(JOYPAD *pThisPad)
pThisPad->m_uiButtons |= _360_JOY_BUTTON_BACK;
}
if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_TOUCHPAD))
//str1k3r - Only check the touchpad if we have one
if (SDL_GetNumGamepadTouchpads(pGamePad) > 0)
{
pThisPad->m_uiButtons |= _PS_JOY_BUTTON_TOUCHPAD;
if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_TOUCHPAD))
{
pThisPad->m_uiButtons |= _PS_JOY_BUTTON_TOUCHPAD;
}
}
if (SDL_GetGamepadButton(pGamePad, SDL_GAMEPAD_BUTTON_LEFT_STICK))