Don't do deadzone scaling because the PC should be handling that. Return to non-scaled controller packets. Disable the deadzone option in preferences.

This commit is contained in:
Cameron Gutman 2014-11-20 00:00:48 -08:00
parent 8dee1f0d80
commit e912e4de57
2 changed files with 15 additions and 6 deletions

View File

@ -50,15 +50,16 @@ public class ControllerHandler {
public ControllerHandler(NvConnection conn, int deadzonePercentage) {
this.conn = conn;
// HACK: For now we're hardcoding a 10% deadzone. Some deadzone
// is required for controller batching support to work.
deadzonePercentage = 10;
// 1% is the lowest possible deadzone we support
if (deadzonePercentage <= 0) {
deadzonePercentage = 1;
}
this.stickDeadzone = (double)deadzonePercentage / 100.0;
// We want limelight-common to scale the axis values to match Xinput values
ControllerPacket.enableAxisScaling = true;
// Initialize the default mapping for events with no device
defaultMapping.leftStickXAxis = MotionEvent.AXIS_X;
@ -337,7 +338,12 @@ public class ControllerHandler {
// Deadzone -- return the zero vector
return Vector2d.ZERO;
}
else {
else {
/*
FIXME: We're not normalizing here because we let the computer handle the deadzones.
Normalizing can make the deadzones larger than they should be after the computer also
evaluates the deadzone
// Scale the input based on the distance from the deadzone
inputVector.getNormalized(normalizedInputVector);
normalizedInputVector.scalarMultiply((inputVector.getMagnitude() - deadzoneRadius) / (1.0f - deadzoneRadius));
@ -359,6 +365,9 @@ public class ControllerHandler {
}
return normalizedInputVector;
*/
return inputVector;
}
}

View File

@ -26,14 +26,14 @@
android:summary="@string/summary_checkbox_disable_warnings"
android:defaultValue="false" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/category_gamepad_settings">
<!--PreferenceCategory android:title="@string/category_gamepad_settings">
<com.limelight.preferences.SeekBarPreference
android:key="seekbar_deadzone"
android:defaultValue="15"
android:max="50"
android:text="@string/suffix_seekbar_deadzone"
android:title="@string/title_seekbar_deadzone"/>
</PreferenceCategory>
</PreferenceCategory-->
<PreferenceCategory android:title="@string/category_host_settings">
<CheckBoxPreference
android:key="checkbox_enable_sops"