mirror of
https://github.com/encounter/SDL.git
synced 2025-05-22 15:21:27 +00:00
Virtual joysticks don't need initial axis jitter protection
Fixes https://github.com/libsdl-org/SDL/issues/6426
This commit is contained in:
parent
0e1d19cf68
commit
5b8f830e34
@ -1530,7 +1530,8 @@ SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value)
|
|||||||
if (!info->sent_initial_value) {
|
if (!info->sent_initial_value) {
|
||||||
/* Make sure we don't send motion until there's real activity on this axis */
|
/* Make sure we don't send motion until there's real activity on this axis */
|
||||||
const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */
|
const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */
|
||||||
if (SDL_abs(value - info->value) <= MAX_ALLOWED_JITTER) {
|
if (SDL_abs(value - info->value) <= MAX_ALLOWED_JITTER &&
|
||||||
|
!SDL_IsJoystickVirtual(joystick->guid)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
info->sent_initial_value = SDL_TRUE;
|
info->sent_initial_value = SDL_TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user