Android: Allow finger movement while pressing button

This commit is contained in:
Sean 2014-04-21 21:24:49 -04:00
parent 78b3eb1e64
commit 72f3d69a78
1 changed files with 2 additions and 1 deletions

View File

@ -116,7 +116,8 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
//
// TODO: Refactor this so we detect either Axis movements or button presses so we don't run two loops all the time.
//
int buttonState = (event.getAction() == MotionEvent.ACTION_DOWN) ? ButtonState.PRESSED : ButtonState.RELEASED;
int buttonState = (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE)
? ButtonState.PRESSED : ButtonState.RELEASED;
// Check if there was a touch within the bounds of a drawable.
for (InputOverlayDrawableButton button : overlayButtons)
{