I'm using an SVN build, but not the latest. The latest would start, run a few seconds, then quit itself, leaving no reason for the auto-quit in the sderr file.
In the build I'm using, tweaking kdeadzone had no noticeable effect at all. I tweaked it all the way to 10.0 before I gave up that direction and put it back on 0.02.
Here's the working solution I landed on.
In JoystickHandler.h:
That reduces the joystick axis sensitivity by 25%. It works out well; recent builds seem to be very oversensitive to joystick inputs compared to version 1.65.
In PlayerEntityControls.m, a variation of Luke's deadzone code, which works. Note I applied the code to the yaw axis as well; I have a 4-axis HOTAS stick, and I use "wing commander" flight control settings - pitch and yaw on the stick, roll on the rudder rocker, and speed on the throttle.
Code: Select all
else if(numSticks)
{
virtualStick=[stickHandler getRollPitchAxis];
if(virtualStick.x == STICK_AXISUNASSIGNED ||
virtualStick.y == STICK_AXISUNASSIGNED)
{
// Not assigned - set to zero.
virtualStick.x=0;
virtualStick.y=0;
}
if ( ((virtualStick.x > -0.04) && (virtualStick.x < 0.04)) &&
((virtualStick.y > -0.04) && (virtualStick.y < 0.04)) )
{
virtualStick.x = 0.0;
virtualStick.y = 0.0;
}
else if(virtualStick.x != 0 ||
virtualStick.y != 0)
{
// cancel keyboard override, stick has been waggled
keyboardRollPitchOverride=NO;
}
// handle yaw separately from pitch/roll
reqYaw = [stickHandler getAxisState: AXIS_YAW];
if(reqYaw == STICK_AXISUNASSIGNED)
{
reqYaw=0;
}
if ( ((reqYaw > -0.04) && (reqYaw < 0.04)) )
{
reqYaw = 0.0;
}
These alterations virtually eliminated the drift. My joystick software kills what tiny bit remains with slight axis trim settings.