aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2023-07-18 10:12:40 +0800
committerPo Lu2023-07-18 10:12:40 +0800
commit5ff31bf36cf00f9d5a378ce139fd5c2ae8d3f25e (patch)
tree5f1d6659da915840edcb12ed1931a8c379cedfce /java
parent46fd03a49617066fca87000378771caedfd150f3 (diff)
downloademacs-5ff31bf36cf00f9d5a378ce139fd5c2ae8d3f25e.tar.gz
emacs-5ff31bf36cf00f9d5a378ce139fd5c2ae8d3f25e.zip
Update Android port
* doc/lispref/commands.texi (Touchscreen Events): Describe treatment of canceled touch sequences during touch event translation. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): Update JNI prototypes. * java/org/gnu/emacs/EmacsWindow.java (motionEvent): Set cancelation flag in events sent where appropriate. * lisp/touch-screen.el (touch-screen-handle-point-update): Improve treatment of horizontal scrolling near window edges. (touch-screen-handle-touch): Don't handle point up if the touch sequence has been canceled. * src/android.c (sendTouchDown, sendTouchUp, sendTouchMove): New argument `flags'. * src/androidgui.h (enum android_touch_event_flags): New enum. (struct android_touch_event): New field `flags'. * src/androidterm.c (handle_one_android_event): Report cancelation in TOUCHSCREEN_END_EVENTs. * src/keyboard.c (make_lispy_event): Fix botched merge.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsNative.java9
-rw-r--r--java/org/gnu/emacs/EmacsWindow.java19
2 files changed, 19 insertions, 9 deletions
diff --git a/java/org/gnu/emacs/EmacsNative.java b/java/org/gnu/emacs/EmacsNative.java
index 1331539879a..d4d502ede5a 100644
--- a/java/org/gnu/emacs/EmacsNative.java
+++ b/java/org/gnu/emacs/EmacsNative.java
@@ -142,15 +142,18 @@ public final class EmacsNative
142 142
143 /* Send an ANDROID_TOUCH_DOWN event. */ 143 /* Send an ANDROID_TOUCH_DOWN event. */
144 public static native long sendTouchDown (short window, int x, int y, 144 public static native long sendTouchDown (short window, int x, int y,
145 long time, int pointerID); 145 long time, int pointerID,
146 int flags);
146 147
147 /* Send an ANDROID_TOUCH_UP event. */ 148 /* Send an ANDROID_TOUCH_UP event. */
148 public static native long sendTouchUp (short window, int x, int y, 149 public static native long sendTouchUp (short window, int x, int y,
149 long time, int pointerID); 150 long time, int pointerID,
151 int flags);
150 152
151 /* Send an ANDROID_TOUCH_MOVE event. */ 153 /* Send an ANDROID_TOUCH_MOVE event. */
152 public static native long sendTouchMove (short window, int x, int y, 154 public static native long sendTouchMove (short window, int x, int y,
153 long time, int pointerID); 155 long time, int pointerID,
156 int flags);
154 157
155 /* Send an ANDROID_WHEEL event. */ 158 /* Send an ANDROID_WHEEL event. */
156 public static native long sendWheel (short window, int x, int y, 159 public static native long sendWheel (short window, int x, int y,
diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java
index 0e96a8382d0..8118479319e 100644
--- a/java/org/gnu/emacs/EmacsWindow.java
+++ b/java/org/gnu/emacs/EmacsWindow.java
@@ -1025,23 +1025,30 @@ public final class EmacsWindow extends EmacsHandleObject
1025 /* Touch down event. */ 1025 /* Touch down event. */
1026 EmacsNative.sendTouchDown (this.handle, coordinate.x, 1026 EmacsNative.sendTouchDown (this.handle, coordinate.x,
1027 coordinate.y, time, 1027 coordinate.y, time,
1028 coordinate.id); 1028 coordinate.id, 0);
1029 break; 1029 break;
1030 1030
1031 case MotionEvent.ACTION_UP: 1031 case MotionEvent.ACTION_UP:
1032 case MotionEvent.ACTION_POINTER_UP: 1032 case MotionEvent.ACTION_POINTER_UP:
1033 /* Touch up event. */
1034 EmacsNative.sendTouchUp (this.handle, coordinate.x,
1035 coordinate.y, time,
1036 coordinate.id, 0);
1037 break;
1038
1033 case MotionEvent.ACTION_CANCEL: 1039 case MotionEvent.ACTION_CANCEL:
1034 /* Touch up event. Android documentation says ACTION_CANCEL 1040 /* Touch sequence cancellation event. */
1035 should be treated as more or less equivalent to ACTION_UP,
1036 so that is what is done here. */
1037 EmacsNative.sendTouchUp (this.handle, coordinate.x, 1041 EmacsNative.sendTouchUp (this.handle, coordinate.x,
1038 coordinate.y, time, coordinate.id); 1042 coordinate.y, time,
1043 coordinate.id,
1044 1 /* ANDROID_TOUCH_SEQUENCE_CANCELED */);
1039 break; 1045 break;
1040 1046
1041 case MotionEvent.ACTION_MOVE: 1047 case MotionEvent.ACTION_MOVE:
1042 /* Pointer motion event. */ 1048 /* Pointer motion event. */
1043 EmacsNative.sendTouchMove (this.handle, coordinate.x, 1049 EmacsNative.sendTouchMove (this.handle, coordinate.x,
1044 coordinate.y, time, coordinate.id); 1050 coordinate.y, time,
1051 coordinate.id, 0);
1045 break; 1052 break;
1046 } 1053 }
1047 } 1054 }