Browse Source

Fixed controller mapping issues caused by PS3 gyro jitter

Sam Lantinga 5 years ago
parent
commit
8342fa7c7e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/joystick/SDL_joystick.c

+ 1 - 1
src/joystick/SDL_joystick.c

@@ -842,7 +842,7 @@ SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value)
 
     info = &joystick->axes[axis];
     if (!info->has_initial_value ||
-        (!info->has_second_value && info->initial_value == -32768 && value == 0)) {
+        (!info->has_second_value && info->initial_value == -32768 && SDL_abs(value) < (SDL_JOYSTICK_AXIS_MAX / 4))) {
         info->initial_value = value;
         info->value = value;
         info->zero = value;