mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
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:
parent
8dee1f0d80
commit
e912e4de57
@ -50,15 +50,16 @@ public class ControllerHandler {
|
|||||||
public ControllerHandler(NvConnection conn, int deadzonePercentage) {
|
public ControllerHandler(NvConnection conn, int deadzonePercentage) {
|
||||||
this.conn = conn;
|
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
|
// 1% is the lowest possible deadzone we support
|
||||||
if (deadzonePercentage <= 0) {
|
if (deadzonePercentage <= 0) {
|
||||||
deadzonePercentage = 1;
|
deadzonePercentage = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stickDeadzone = (double)deadzonePercentage / 100.0;
|
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
|
// Initialize the default mapping for events with no device
|
||||||
defaultMapping.leftStickXAxis = MotionEvent.AXIS_X;
|
defaultMapping.leftStickXAxis = MotionEvent.AXIS_X;
|
||||||
@ -337,7 +338,12 @@ public class ControllerHandler {
|
|||||||
// Deadzone -- return the zero vector
|
// Deadzone -- return the zero vector
|
||||||
return Vector2d.ZERO;
|
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
|
// Scale the input based on the distance from the deadzone
|
||||||
inputVector.getNormalized(normalizedInputVector);
|
inputVector.getNormalized(normalizedInputVector);
|
||||||
normalizedInputVector.scalarMultiply((inputVector.getMagnitude() - deadzoneRadius) / (1.0f - deadzoneRadius));
|
normalizedInputVector.scalarMultiply((inputVector.getMagnitude() - deadzoneRadius) / (1.0f - deadzoneRadius));
|
||||||
@ -359,6 +365,9 @@ public class ControllerHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return normalizedInputVector;
|
return normalizedInputVector;
|
||||||
|
*/
|
||||||
|
|
||||||
|
return inputVector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,14 +26,14 @@
|
|||||||
android:summary="@string/summary_checkbox_disable_warnings"
|
android:summary="@string/summary_checkbox_disable_warnings"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/category_gamepad_settings">
|
<!--PreferenceCategory android:title="@string/category_gamepad_settings">
|
||||||
<com.limelight.preferences.SeekBarPreference
|
<com.limelight.preferences.SeekBarPreference
|
||||||
android:key="seekbar_deadzone"
|
android:key="seekbar_deadzone"
|
||||||
android:defaultValue="15"
|
android:defaultValue="15"
|
||||||
android:max="50"
|
android:max="50"
|
||||||
android:text="@string/suffix_seekbar_deadzone"
|
android:text="@string/suffix_seekbar_deadzone"
|
||||||
android:title="@string/title_seekbar_deadzone"/>
|
android:title="@string/title_seekbar_deadzone"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory-->
|
||||||
<PreferenceCategory android:title="@string/category_host_settings">
|
<PreferenceCategory android:title="@string/category_host_settings">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="checkbox_enable_sops"
|
android:key="checkbox_enable_sops"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user