blob: bf498d1fbc59b727cec15bfb67952ea92850cff2 (
plain)
1
2
3
4
5
6
|
<h4 class="subsection">Button-Down Events</h4> <p>Click and drag events happen when the user releases a mouse button. They cannot happen earlier, because there is no way to distinguish a click from a drag until the button is released. </p> <p>If you want to take action as soon as a button is pressed, you need to handle <em>button-down</em> events.<a id="DOCF16" href="#FOOT16"><sup>16</sup></a> These occur as soon as a button is pressed. They are represented by lists that look exactly like click events (see <a href="click-events">Click Events</a>), except that the <var>event-type</var> symbol name contains the prefix ‘<samp>down-</samp>’. The ‘<samp>down-</samp>’ prefix follows modifier key prefixes such as ‘<samp>C-</samp>’ and ‘<samp>M-</samp>’. </p> <p>The function <code>read-key-sequence</code> ignores any button-down events that don’t have command bindings; therefore, the Emacs command loop ignores them too. This means that you need not worry about defining button-down events unless you want them to do something. The usual reason to define a button-down event is so that you can track mouse motion (by reading motion events) until the button is released. See <a href="motion-events">Motion Events</a>. </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/Button_002dDown-Events.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Button_002dDown-Events.html</a>
</p>
</div>
|