mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix controller packet loss when zeroing analog sticks on OSC
This commit is contained in:
parent
6adc9dcb2d
commit
7eac0ccaf8
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 4f5ce68e8ce2e6e814fa5e7c66cabd4602929993
|
Subproject commit 1af5c24e56e3d0b4cae477346306075129b8ddf8
|
Loading…
x
Reference in New Issue
Block a user