From a9a8d5e95992ab63a63305e2a0b2d2b36bb2c698 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 15 Nov 2023 20:58:46 +0800 Subject: 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) : 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. --- java/org/gnu/emacs/EmacsWindow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java') diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index d7a37a8d57f..013f09cb756 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -918,8 +918,8 @@ public final class EmacsWindow extends EmacsHandleObject it in the map. */ pointerIndex = event.getActionIndex (); pointerID = event.getPointerId (pointerIndex); - coordinate = new Coordinate ((int) event.getX (0), - (int) event.getY (0), + coordinate = new Coordinate ((int) event.getX (pointerIndex), + (int) event.getY (pointerIndex), buttonForEvent (event), pointerID); pointerMap.put (pointerID, coordinate); -- cgit v1.2.1