From e4b85091fd0eea25a149af2dd3c2a24f99128baa Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 25 Aug 2022 10:15:45 -0700 Subject: [PATCH] Document the range of trigger axes for virtual joysticks Fixes https://github.com/libsdl-org/SDL/issues/6130 --- include/SDL_joystick.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/SDL_joystick.h b/include/SDL_joystick.h index 1a7c66ee2..cb7be29af 100644 --- a/include/SDL_joystick.h +++ b/include/SDL_joystick.h @@ -425,6 +425,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, * SDL_WaitEvent. * + * Note that when sending trigger axes, you should scale the value to the full range of Sint16. For example, a trigger at rest would have the value of `SDL_JOYSTICK_AXIS_MIN`. + * * \param joystick the virtual joystick on which to set state. * \param axis the specific axis on the virtual joystick to set. * \param value the new value for the specified axis.