aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidterm.c
diff options
context:
space:
mode:
authorPo Lu2023-11-15 20:58:46 +0800
committerPo Lu2023-11-15 21:07:14 +0800
commita9a8d5e95992ab63a63305e2a0b2d2b36bb2c698 (patch)
tree3c8317f4e782afd2b988141231f199ac0eaf2c53 /src/androidterm.c
parent03d2e26108b21b4a9c86a30e5552f9535f4245ac (diff)
downloademacs-a9a8d5e95992ab63a63305e2a0b2d2b36bb2c698.tar.gz
emacs-a9a8d5e95992ab63a63305e2a0b2d2b36bb2c698.zip
Register ``pinch to zoom'' touch screen gestures
* doc/emacs/input.texi (Touchscreens): Address pinch gestures. * doc/lispref/commands.texi (Touchscreen Events): Address touch screen pinch events and the process by which they are produced. * java/org/gnu/emacs/EmacsWindow.java (figureChange) <ACTION_POINTER_DOWN>: Supply pointer index to getX and getY, correcting a mistake where the first touch point's coordinate was saved here in lieu of the pointer that was pressed's. * lisp/touch-screen.el (touch-screen-current-tool): Revise doc string. (touch-screen-aux-tool): New variable. (touch-screen-scroll-point-to-y, touch-screen-pinch): New functions. (global-map): Bind [touchscreen-pinch] to touch-screen-pinch. (touch-screen-handle-point-update): Revise doc string; set new tenth field of t-s-c-t to POINT relative to its window, without regard to whether an event has been sent. (touch-screen-distance, touch-screen-centrum): New functions. (touch-screen-handle-aux-point-update): New function; generate and send touchscreen-pinch if need be. (touch-screen-handle-point-up): If an ancillary tool exists, transfer the information there into touch-screen-current-tool and clear t-s-a-t. (touch-screen-handle-touch): Call t-s-a-p-u as is proper; set t-s-a-t if a touchscreen-down event arrives and t-s-c-t is set. * src/androidterm.c (handle_one_android_event): Properly save the event's X and Y when a new touch point is registered.
Diffstat (limited to 'src/androidterm.c')
-rw-r--r--src/androidterm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/androidterm.c b/src/androidterm.c
index 1593cac36ba..cfb64cd69a0 100644
--- a/src/androidterm.c
+++ b/src/androidterm.c
@@ -1377,7 +1377,7 @@ handle_one_android_event (struct android_display_info *dpyinfo,
1377 { 1377 {
1378 /* Simply update the tool position and send an update. */ 1378 /* Simply update the tool position and send an update. */
1379 touchpoint->x = event->touch.x; 1379 touchpoint->x = event->touch.x;
1380 touchpoint->y = event->touch.x; 1380 touchpoint->y = event->touch.y;
1381 android_update_tools (any, &inev.ie); 1381 android_update_tools (any, &inev.ie);
1382 inev.ie.timestamp = event->touch.time; 1382 inev.ie.timestamp = event->touch.time;
1383 1383
@@ -1390,7 +1390,7 @@ handle_one_android_event (struct android_display_info *dpyinfo,
1390 touchpoint = xmalloc (sizeof *touchpoint); 1390 touchpoint = xmalloc (sizeof *touchpoint);
1391 touchpoint->tool_id = event->touch.pointer_id; 1391 touchpoint->tool_id = event->touch.pointer_id;
1392 touchpoint->x = event->touch.x; 1392 touchpoint->x = event->touch.x;
1393 touchpoint->y = event->touch.x; 1393 touchpoint->y = event->touch.y;
1394 touchpoint->next = FRAME_OUTPUT_DATA (any)->touch_points; 1394 touchpoint->next = FRAME_OUTPUT_DATA (any)->touch_points;
1395 touchpoint->tool_bar_p = false; 1395 touchpoint->tool_bar_p = false;
1396 FRAME_OUTPUT_DATA (any)->touch_points = touchpoint; 1396 FRAME_OUTPUT_DATA (any)->touch_points = touchpoint;