|
|
@ -25,7 +25,7 @@ import java.util.logging.Logger; |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class AndroidInput extends GLSurfaceView implements TouchInput, |
|
|
|
public class AndroidInput extends GLSurfaceView implements TouchInput, |
|
|
|
GestureDetector.OnGestureListener, ScaleGestureDetector.OnScaleGestureListener { |
|
|
|
GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener, ScaleGestureDetector.OnScaleGestureListener { |
|
|
|
|
|
|
|
|
|
|
|
final private static int MAX_EVENTS = 1024; |
|
|
|
final private static int MAX_EVENTS = 1024; |
|
|
|
// Custom settings
|
|
|
|
// Custom settings
|
|
|
@ -220,7 +220,7 @@ public class AndroidInput extends GLSurfaceView implements TouchInput, |
|
|
|
boolean bWasHandled = false; |
|
|
|
boolean bWasHandled = false; |
|
|
|
TouchEvent touch; |
|
|
|
TouchEvent touch; |
|
|
|
|
|
|
|
|
|
|
|
// Try to detect gestures
|
|
|
|
// Try to detect gestures
|
|
|
|
this.detector.onTouchEvent(event); |
|
|
|
this.detector.onTouchEvent(event); |
|
|
|
this.scaledetector.onTouchEvent(event); |
|
|
|
this.scaledetector.onTouchEvent(event); |
|
|
|
|
|
|
|
|
|
|
@ -570,6 +570,10 @@ public class AndroidInput extends GLSurfaceView implements TouchInput, |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean onDoubleTapEvent(MotionEvent event) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean onScaleBegin(ScaleGestureDetector scaleGestureDetector) { |
|
|
|
public boolean onScaleBegin(ScaleGestureDetector scaleGestureDetector) { |
|
|
|
TouchEvent touch = getNextFreeTouchEvent(); |
|
|
|
TouchEvent touch = getNextFreeTouchEvent(); |
|
|
|
touch.set(Type.SCALE_START, scaleGestureDetector.getFocusX(), scaleGestureDetector.getFocusY(), 0f, 0f); |
|
|
|
touch.set(Type.SCALE_START, scaleGestureDetector.getFocusX(), scaleGestureDetector.getFocusY(), 0f, 0f); |
|
|
|