Raise the minimum button down threshold to minimize missed start button presses on OUYA

This commit is contained in:
Cameron Gutman 2014-06-01 17:11:40 -04:00
parent 5626e9663b
commit e7501a488d

View File

@ -29,7 +29,7 @@ public class ControllerHandler {
private long lastRbUpTime = 0; private long lastRbUpTime = 0;
private static final int MAXIMUM_BUMPER_UP_DELAY_MS = 100; private static final int MAXIMUM_BUMPER_UP_DELAY_MS = 100;
private static final int MINIMUM_BUTTON_DOWN_TIME_MS = 5; private static final int MINIMUM_BUTTON_DOWN_TIME_MS = 10;
private static final int EMULATING_SPECIAL = 0x1; private static final int EMULATING_SPECIAL = 0x1;
private static final int EMULATING_SELECT = 0x2; private static final int EMULATING_SELECT = 0x2;
@ -322,7 +322,7 @@ public class ControllerHandler {
// path should not be triggered during normal usage. // path should not be triggered during normal usage.
if (SystemClock.uptimeMillis() - event.getDownTime() < ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS) if (SystemClock.uptimeMillis() - event.getDownTime() < ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS)
{ {
// Since our sleep time is so short (5 ms), it shouldn't cause a problem doing this in the // Since our sleep time is so short (10 ms), it shouldn't cause a problem doing this in the
// UI thread. // UI thread.
try { try {
Thread.sleep(ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS); Thread.sleep(ControllerHandler.MINIMUM_BUTTON_DOWN_TIME_MS);