forked from kivy/python-for-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSDLSurface.java.patch
More file actions
25 lines (24 loc) · 931 Bytes
/
SDLSurface.java.patch
File metadata and controls
25 lines (24 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- a/src/main/java/org/libsdl/app/SDLSurface.java
+++ b/src/main/java/org/libsdl/app/SDLSurface.java
@@ -193,9 +193,22 @@
return SDLActivity.handleKeyEvent(v, keyCode, event, null);
}
+ public interface OnInterceptTouchListener {
+ boolean onTouch(MotionEvent ev);
+ }
+
+ private OnInterceptTouchListener mOnInterceptTouchListener = null;
+
+ public void setInterceptTouchListener(OnInterceptTouchListener listener) {
+ this.mOnInterceptTouchListener = listener;
+ }
+
// Touch events
@Override
public boolean onTouch(View v, MotionEvent event) {
+ if (mOnInterceptTouchListener != null)
+ if (mOnInterceptTouchListener.onTouch(event))
+ return false;
/* Ref: http://developer.android.com/training/gestures/multi.html */
int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();