mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-24 01:06:39 +00:00
Fix controller packet loss when zeroing analog sticks on OSC
This commit is contained in:
@@ -338,6 +338,16 @@ public class AnalogStick extends VirtualControllerElement {
|
|||||||
} else {
|
} else {
|
||||||
stick_state = STICK_STATE.NO_MOVEMENT;
|
stick_state = STICK_STATE.NO_MOVEMENT;
|
||||||
notifyOnRevoke();
|
notifyOnRevoke();
|
||||||
|
|
||||||
|
// HACK: We can sometimes generate back-to-back controller events
|
||||||
|
// that cause GFE to drop newer data. Dropping zeroing events would
|
||||||
|
// be disastrous because we may not get a follow-up joystick event to
|
||||||
|
// correct the dropped zeroing packet. Delay 5 ms when raising the
|
||||||
|
// analog stick to ensure this doesn't happen.
|
||||||
|
try {
|
||||||
|
Thread.sleep(5);
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
// not longer pressed reset analog stick
|
// not longer pressed reset analog stick
|
||||||
notifyOnMovement(0, 0);
|
notifyOnMovement(0, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule moonlight-common updated: 4f5ce68e8c...1af5c24e56
Reference in New Issue
Block a user