mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-20 23:36:53 +00:00
Fix controller packet loss when zeroing analog sticks on OSC
This commit is contained in:
1 parent
6adc9dcb2d
commit
7eac0ccaf8
2 files changed
+11
-1
No files matched your search
@@ -338,6 +338,16 @@ public class AnalogStick extends VirtualControllerElement {
|
||||
} else {
|
||||
stick_state = STICK_STATE.NO_MOVEMENT;
|
||||
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
|
||||
notifyOnMovement(0, 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user