diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/drag-events.html | |
new repository
Diffstat (limited to 'devdocs/elisp/drag-events.html')
| -rw-r--r-- | devdocs/elisp/drag-events.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/elisp/drag-events.html b/devdocs/elisp/drag-events.html new file mode 100644 index 00000000..c376d954 --- /dev/null +++ b/devdocs/elisp/drag-events.html @@ -0,0 +1,10 @@ + <h4 class="subsection">Drag Events</h4> <p>With Emacs, you can have a drag event without even changing your clothes. A <em>drag event</em> happens every time the user presses a mouse button and then moves the mouse to a different character position before releasing the button. Like all mouse events, drag events are represented in Lisp as lists. The lists record both the starting mouse position and the final position, like this: </p> <div class="example"> <pre class="example">(<var>event-type</var> + (<var>window1</var> START-POSITION) + (<var>window2</var> END-POSITION)) +</pre> +</div> <p>For a drag event, the name of the symbol <var>event-type</var> contains the prefix ‘<samp>drag-</samp>’. For example, dragging the mouse with button 2 held down generates a <code>drag-mouse-2</code> event. The second and third elements of the event give the starting and ending position of the drag, as mouse position lists (see <a href="click-events">Click Events</a>). 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. </p> <p>The ‘<samp>drag-</samp>’ prefix follows the modifier key prefixes such as ‘<samp>C-</samp>’ and ‘<samp>M-</samp>’. </p> <p>If <code>read-key-sequence</code> receives a drag event that has no key binding, and the corresponding click event does have a binding, it changes the drag event into a click event at the drag’s starting position. This means that you don’t have to distinguish between click and drag events unless you want to. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Drag-Events.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Drag-Events.html</a> + </p> +</div> |
