Commit ad2bb3e9 authored by Po Lu's avatar Po Lu
Browse files

Properly translate touch screen events into mouse drag ones

* doc/lispref/commands.texi (Drag Events): Correct misleading
example form and reword subsequent elaboration.

* lisp/touch-screen.el (touch-screen-handle-point-up)
<mouse-drag>: Set posns representing drag start and terminus to
mouse position lists, in lieu of pairs between windows and posns
employed previously.
parent db704687
Pipeline #26637 failed with stages
in 203 minutes and 58 seconds
......@@ -1854,20 +1854,19 @@ represented in Lisp as lists. The lists record both the starting mouse
position and the final position, like this:
@example
(@var{event-type}
(@var{window1} START-POSITION)
(@var{window2} END-POSITION))
(@var{event-type} @var{start-position} @var{end-position})
@end example
For a drag event, the name of the symbol @var{event-type} contains the
prefix @samp{drag-}. For example, dragging the mouse with button 2
held down generates a @code{drag-mouse-2} event. The second and third
elements of the event give the starting and ending position of the
drag, as mouse position lists (@pxref{Click Events}). You can access
the second element of any mouse event in the same way. However, the
drag event may end outside the boundaries of the frame that was
initially selected. In that case, the third element's position list
contains that frame in place of a window.
elements of the event, @var{start-position} and @var{end-position} in
the foregoing illustration, are set to the start and end positions of
the drag as mouse position lists (@pxref{Click Events}). You can
access the second element of any mouse event in the same way.
However, the drag event may end outside the boundaries of the frame
that was initially selected. In that case, the third element's
position list contains that frame in place of a window.
The @samp{drag-} prefix follows the modifier key prefixes such as
@samp{C-} and @samp{M-}.
......
......@@ -1140,9 +1140,7 @@ is not read-only."
;; ... generate a mouse-1 event...
(list 'mouse-1 posn)
;; ... otherwise, generate a drag-mouse-1 event.
(list 'drag-mouse-1 (cons old-window
old-posn)
(cons new-window posn))))
(list 'drag-mouse-1 old-posn posn)))
(if (and (eq new-window old-window)
(eq new-point old-point)
(windowp new-window)
......@@ -1150,9 +1148,7 @@ is not read-only."
;; ... generate a mouse-1 event...
(list 'mouse-1 posn)
;; ... otherwise, generate a drag-mouse-1 event.
(list 'drag-mouse-1 (cons old-window
old-posn)
(cons new-window posn)))))))
(list 'drag-mouse-1 old-posn posn))))))
((eq what 'mouse-1-menu)
;; Generate a `down-mouse-1' event at the position the tap
;; took place.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment