Skip to content

Commit

Permalink
Use a better default deadzone value for Linux. Fixes uncontrollable m…
Browse files Browse the repository at this point in the history
…enus
  • Loading branch information
nashmuhandes authored and coelckers committed Feb 2, 2024
1 parent 989123b commit f6bdc02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/common/platform/posix/sdl/i_joystick.cpp
Expand Up @@ -38,6 +38,8 @@
#include "m_joy.h"
#include "keydef.h"

#define DEFAULT_DEADZONE 0.25f;

// Very small deadzone so that floating point magic doesn't happen
#define MIN_DEADZONE 0.000001f

Expand Down Expand Up @@ -143,7 +145,7 @@ class SDLInputJoystick: public IJoystickConfig
info.Name.Format("Axis %d", i+1);
else
info.Name.Format("Hat %d (%c)", (i-NumAxes)/2 + 1, (i-NumAxes)%2 == 0 ? 'x' : 'y');
info.DeadZone = MIN_DEADZONE;
info.DeadZone = DEFAULT_DEADZONE;
info.Multiplier = 1.0f;
info.Value = 0.0;
info.ButtonValue = 0;
Expand Down

0 comments on commit f6bdc02

Please sign in to comment.