mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-16 22:01:14 +00:00
Compensate for button down time when computing extra minimum button down
This commit is contained in:
@@ -1505,10 +1505,10 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
|||||||
int buttonDownTime = (int)(event.getEventTime() - event.getDownTime());
|
int buttonDownTime = (int)(event.getEventTime() - event.getDownTime());
|
||||||
if (buttonDownTime < ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS)
|
if (buttonDownTime < ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS)
|
||||||
{
|
{
|
||||||
// Since our sleep time is so short (10 ms), it shouldn't cause a problem doing this in the
|
// Since our sleep time is so short (<= 25 ms), it shouldn't cause a problem doing this
|
||||||
// UI thread.
|
// in the UI thread.
|
||||||
try {
|
try {
|
||||||
Thread.sleep(ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS);
|
Thread.sleep(ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS - buttonDownTime);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user