From cdc19228015bc6ff9799f949b439cb97b586d2e8 Mon Sep 17 00:00:00 2001
From: Vicki Pfau <[EMAIL REDACTED]>
Date: Thu, 9 Oct 2025 15:43:07 -0700
Subject: [PATCH] switch2: This is the zero point, not the max
---
src/joystick/hidapi/SDL_hidapi_switch2.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/joystick/hidapi/SDL_hidapi_switch2.c b/src/joystick/hidapi/SDL_hidapi_switch2.c
index 1eb39bcc2c54b..f762c423be15e 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch2.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch2.c
@@ -97,8 +97,8 @@ typedef struct
Switch2_StickCalibration left_stick;
Switch2_StickCalibration right_stick;
- Uint8 left_trigger_max;
- Uint8 right_trigger_max;
+ Uint8 left_trigger_zero;
+ Uint8 right_trigger_zero;
bool player_lights;
int player_index;
@@ -389,8 +389,8 @@ static bool HIDAPI_DriverSwitch2_InitUSB(SDL_HIDAPI_Device *device)
if (res < 0) {
SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Couldn't read factory calibration data: %d", res);
} else {
- ctx->left_trigger_max = calibration_data[0x10];
- ctx->right_trigger_max = calibration_data[0x11];
+ ctx->left_trigger_zero = calibration_data[0x10];
+ ctx->right_trigger_zero = calibration_data[0x11];
}
}
}
@@ -597,14 +597,14 @@ static void HandleGameCubeState(Uint64 timestamp, SDL_Joystick *joystick, SDL_Dr
timestamp,
joystick,
SDL_GAMEPAD_AXIS_LEFT_TRIGGER,
- ctx->left_trigger_max,
+ ctx->left_trigger_zero,
data[13]
);
MapTriggerAxis(
timestamp,
joystick,
SDL_GAMEPAD_AXIS_RIGHT_TRIGGER,
- ctx->right_trigger_max,
+ ctx->right_trigger_zero,
data[14]
);