From c95e8478908357de1b936a3bd0c4d8433bf8175e Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 3 Jan 2021 02:26:32 +0000 Subject: [PATCH] Fix joystick trigger thresholds They were negative by default but they should've been positive: > a value ranging from -32768 to 32767. Triggers, however, range from 0 to 32767 (they never return a negative value). https://wiki.libsdl.org/SDL_GameControllerGetAxis This fixes LTRIGGER and RTRIGGER (L2/Zl and R2/Zr on most gamepads) --- engine/client/in_joy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/client/in_joy.c b/engine/client/in_joy.c index 1eefab41..e731b862 100644 --- a/engine/client/in_joy.c +++ b/engine/client/in_joy.c @@ -385,8 +385,8 @@ void Joy_Init( void ) joy_side = Cvar_Get( "joy_side", "1.0", FCVAR_ARCHIVE, "joystick side sensitivity. Values from -1.0 to 1.0" ); joy_forward = Cvar_Get( "joy_forward", "1.0", FCVAR_ARCHIVE, "joystick forward sensitivity. Values from -1.0 to 1.0" ); - joy_lt_threshold = Cvar_Get( "joy_lt_threshold", "-16384", FCVAR_ARCHIVE, "left trigger threshold. Value from -32768 to 32767"); - joy_rt_threshold = Cvar_Get( "joy_rt_threshold", "-16384", FCVAR_ARCHIVE, "right trigger threshold. Value from -32768 to 32767" ); + joy_lt_threshold = Cvar_Get( "joy_lt_threshold", "16384", FCVAR_ARCHIVE, "left trigger threshold. Value from 0 to 32767"); + joy_rt_threshold = Cvar_Get( "joy_rt_threshold", "16384", FCVAR_ARCHIVE, "right trigger threshold. Value from 0 to 32767" ); // emit a key event at 75% axis move joy_side_key_threshold = Cvar_Get( "joy_side_key_threshold", "24576", FCVAR_ARCHIVE, "side axis key event emit threshold. Value from 0 to 32767" );