The CLX functions affecting pointer position are discussed in the following paragraphs.
query-pointer | window | Function |
Returns the current pointer coordinates relative to the given window. If query-pointer returns nil for same-screen-p , the pointer is not on the same screen as the window . In this case, query-pointer returns a value of nil for child and a value of zero for x and y. If query-pointer returns true for same-screen-p, the returned x and y are relative to the origin of window. The child is the child of the window containing the pointer, if any. The state-mask returned gives the current state of the modifier keys and pointer buttons. The returned root is the root window currently containing the pointer. The returned root-x and root-y specify the pointer coordinates relative to root. |
global-pointer-position | display | Function |
Returns the root window currently containing the display pointer and the current position of the pointer relative to the root. |
pointer-position | window | Function |
Returns the current pointer coordinates relative to the given window. If pointer-position returns nil for same-screen-p , the pointer is not on the same screen as the window . In this case, pointer-position returns a value of nil for child and a value of zero for x and y. If pointer-position returns true for same-screen-p, the returned x and y are relative to the origin of window. |
motion-events | window &key :start :stop (:result-type 'list) | Function |
Many X server implementations maintain a more precise history of pointer motion between event notifications. The pointer position at each pointer hardware interrupt can be stored into a buffer for later retrieval.This is called the motion history buffer. A paint program, for example, may want to have a precise history of where the pointer traveled, even though for most other applications this amount of detail is grossly excessive. The motion-events function returns all events in the motion history buffer that fall between the specified :start and :stop timestamps (inclusive) and have coordinates that lie within the specified window (including borders) at its present placement. If the :start time is later than the :stop time or if the :start time is in the future, no events are returned.
|
warp-pointer | destination destination-x destination-y | Function |
Moves the pointer to the given coordinates relative to the destination window. warp-pointer should be rarely be used since the user should normally be in control of the pointer position. warp-pointer generates events just as if the user had instantaneously moved the pointer from one position to another. warp-pointer cannot move the pointer outside the confine-to window of an active pointer grab; an attempt to do so only moves the pointer as far as the closest edge of the confine-to window. |
warp-pointer-relative | display x-offset y-offset | Function |
Moves the pointer by the given offsets. This function should rarely be used since the user should normally be in control of the pointer position. warp-pointer-relative generates events just as if the user had instantaneously moved the pointer from one position to another. warp-pointer-relative cannot move the pointer outside the confine-to window of an active pointer grab; an attempt to do so only moves the pointer as far as the closest edge of the confine-to window. |
warp-pointer-if-inside | destination destination-x destination-y source source-x source-y &optional (source-width 0) (source-height 0) | Function |
Moves the pointer to the given position relative to the destination window. However, the move can only take place if the pointer is currently contained in a visible portion of the specified rectangle of the source window. If source-height is zero, it is replaced with the current height of source window minus source-y. If source-width is zero, it is replaced with the current width of source window minus source-x. warp-pointer-if-inside generates events just as if the user had instantaneously moved the pointer from one position to another. warp-pointer-if-inside cannot move the pointer outside the confine-to window of an active pointer grab; an attempt to do so only moves the pointer as far as the closest edge of the confine-to window. |
warp-pointer-relative-if-inside | x-offset y-offset source source-x source-y &optional (source-width 0) (source-height 0) | Function |
Moves the pointer by the given offsets. However, the move can only take place if the pointer is currently contained in a visible portion of the specified rectangle of the source window. If source-height is zero, it is replaced with the current height of source-window minus source-y . If source-width is zero, it is replaced with the current width of source-window minus source-x. warp-pointer-relative-if-inside generates events just as if the user had instantaneously moved the pointer from one position to another. warp-pointer-relative-if-inside cannot move the pointer outside the confine-to window of an active pointer grab; an attempt to do so only moves the pointer as far as the closest edge of the confine-to window. |