872 |
* Repeat Events:: Double and triple click (or drag, or down). |
* Repeat Events:: Double and triple click (or drag, or down). |
873 |
* Motion Events:: Just moving the mouse, not pushing a button. |
* Motion Events:: Just moving the mouse, not pushing a button. |
874 |
* Focus Events:: Moving the mouse between frames. |
* Focus Events:: Moving the mouse between frames. |
875 |
* Misc Events:: Other events window systems can generate. |
* Misc Events:: Other events the system can generate. |
876 |
* Event Examples:: Examples of the lists for mouse events. |
* Event Examples:: Examples of the lists for mouse events. |
877 |
* Classifying Events:: Finding the modifier keys in an event symbol. |
* Classifying Events:: Finding the modifier keys in an event symbol. |
878 |
Event types. |
Event types. |
1462 |
sequence, and not within it. |
sequence, and not within it. |
1463 |
|
|
1464 |
@node Misc Events |
@node Misc Events |
1465 |
@subsection Miscellaneous Window System Events |
@subsection Miscellaneous System Events |
1466 |
|
|
1467 |
A few other event types represent occurrences within the window system. |
A few other event types represent occurrences within the system. |
1468 |
|
|
1469 |
@table @code |
@table @code |
1470 |
@cindex @code{delete-frame} event |
@cindex @code{delete-frame} event |
1517 |
|
|
1518 |
This kind of event is generated, at present, only on some kinds of |
This kind of event is generated, at present, only on some kinds of |
1519 |
systems. |
systems. |
1520 |
|
|
1521 |
|
@cindex @code{usr1-signal} event |
1522 |
|
@cindex @code{usr2-signal} event |
1523 |
|
@item usr1-signal |
1524 |
|
@itemx usr2-signal |
1525 |
|
These events are generated when the Emacs process receives the signals |
1526 |
|
@code{SIGUSR1} and @code{SIGUSR2}. They contain no additional data |
1527 |
|
because signals do not carry additional information. |
1528 |
@end table |
@end table |
1529 |
|
|
1530 |
If one of these events arrives in the middle of a key sequence---that |
If one of these events arrives in the middle of a key sequence---that |
1703 |
@end defun |
@end defun |
1704 |
|
|
1705 |
@cindex mouse position list, accessing |
@cindex mouse position list, accessing |
1706 |
These seven functions take a position list as described above, and |
These functions take a position list as described above, and |
1707 |
return various parts of it. |
return various parts of it. |
1708 |
|
|
1709 |
@defun posn-window position |
@defun posn-window position |
1724 |
@end defun |
@end defun |
1725 |
|
|
1726 |
@defun posn-x-y position |
@defun posn-x-y position |
1727 |
Return the pixel-based x and y coordinates in @var{position}, as a cons |
Return the pixel-based x and y coordinates in @var{position}, as a |
1728 |
cell @code{(@var{x} . @var{y})}. |
cons cell @code{(@var{x} . @var{y})}. These coordinates are relative |
1729 |
|
to the window given by @code{posn-window}. |
1730 |
|
|
1731 |
|
This example shows how to convert these window-relative coordinates |
1732 |
|
into frame-relative coordinates: |
1733 |
|
|
1734 |
|
@example |
1735 |
|
(defun frame-relative-coordinates (position) |
1736 |
|
"Return frame-relative coordinates from POSITION." |
1737 |
|
(let* ((x-y (posn-x-y position)) |
1738 |
|
(window (posn-window position)) |
1739 |
|
(edges (window-inside-pixel-edges window))) |
1740 |
|
(cons (+ (car x-y) (car edges)) |
1741 |
|
(+ (cdr x-y) (cadr edges))))) |
1742 |
|
@end example |
1743 |
@end defun |
@end defun |
1744 |
|
|
1745 |
@defun posn-col-row position |
@defun posn-col-row position |
1746 |
Return the row and column (in units of frame default characters) of |
Return the row and column (in units of the frame's default character |
1747 |
@var{position}, as a cons cell @code{(@var{col} . @var{row})}. These |
height and width) of @var{position}, as a cons cell @code{(@var{col} . |
1748 |
are computed from the @var{x} and @var{y} values actually found in |
@var{row})}. These are computed from the @var{x} and @var{y} values |
1749 |
@var{position}. |
actually found in @var{position}. |
1750 |
@end defun |
@end defun |
1751 |
|
|
1752 |
@defun posn-actual-col-row position |
@defun posn-actual-col-row position |
1753 |
Return the actual row and column in @var{position}, as a cons cell |
Return the actual row and column in @var{position}, as a cons cell |
1754 |
@code{(@var{col} . @var{row})}. The values are the actual row number |
@code{(@var{col} . @var{row})}. The values are the actual row number |
1755 |
in the window, and the actual character number in that row. Return |
in the window, and the actual character number in that row. It returns |
1756 |
@code{nil} if @var{position} does not include the actual positions; in that |
@code{nil} if @var{position} does not include actual positions values. |
1757 |
case, @code{posn-col-row} can be used to get approximate values. |
You can use @code{posn-col-row} to get approximate values. |
1758 |
@end defun |
@end defun |
1759 |
|
|
1760 |
@defun posn-string position |
@defun posn-string position |
1793 |
event occurred, in milliseconds. |
event occurred, in milliseconds. |
1794 |
@end defun |
@end defun |
1795 |
|
|
1796 |
|
These functions compute a position list given particular buffer |
1797 |
|
position or screen position. You can access the data in this position |
1798 |
|
list with the functions described above. |
1799 |
|
|
1800 |
|
@defun posn-at-point &optional pos window |
1801 |
|
This function returns a position list for position @var{pos} in |
1802 |
|
@var{window}. @var{pos} defaults to point in @var{window}; |
1803 |
|
@var{window} defaults to the selected window. |
1804 |
|
|
1805 |
|
@code{posn-at-point} returns @code{nil} if @var{pos} is not visible in |
1806 |
|
@var{window}. |
1807 |
|
@end defun |
1808 |
|
|
1809 |
|
@defun posn-at-x-y x y &optional frame-or-window |
1810 |
|
This function returns position information corresponding to pixel |
1811 |
|
coordinates @var{x} and @var{y} in a specified frame or window, |
1812 |
|
@var{frame-or-window}, which defaults to the selected window. |
1813 |
|
The coordinates @var{x} and @var{y} are relative to the |
1814 |
|
frame or window used. |
1815 |
|
@end defun |
1816 |
|
|
1817 |
These functions are useful for decoding scroll bar events. |
These functions are useful for decoding scroll bar events. |
1818 |
|
|
1819 |
@defun scroll-bar-event-ratio event |
@defun scroll-bar-event-ratio event |