ref: 08d6dad3eec9028d82cb8b679fd23635c90c9707
parent: f0356f20725029510207526d4c162156fd8b5449
author: Snesrev <snesrev@protonmail.com>
date: Sun Sep 4 10:18:27 EDT 2022
Tweak multiple gamepad behavior
--- a/main.c
+++ b/main.c
@@ -485,8 +485,10 @@
static void HandleGamepadAxisInput(int gamepad_id, int axis, int value) {
static int last_gamepad_id, last_x, last_y;
if (axis == SDL_CONTROLLER_AXIS_LEFTX || axis == SDL_CONTROLLER_AXIS_LEFTY) {
- // try to be smart if there's more than one gamepad
- if (last_gamepad_id != gamepad_id && (value < -10000 || value > 10000)) {
+ // ignore other gamepads unless they have a big input
+ if (last_gamepad_id != gamepad_id) {
+ if (value > -16000 && value < 16000)
+ return;
last_gamepad_id = gamepad_id;
last_x = last_y = 0;
}