Next Prev Up

12.6 Pointer Position

The CLX functions affecting pointer position are discussed in the following paragraphs.


query-pointer window Function
     
window
A window specifying the coordinate system for the returned position.

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.

x
Type int16.
y
Type int16.
same-screen-p
Type boolean.
child
Type window or null.
state-mask
Type card16.
root-x
Type int16.
root-y
Type int16.
root
Type window.

global-pointer-position display Function
     
display
A display.

Returns the root window currently containing the display pointer and the current position of the pointer relative to the root.

root-x
Type int16.
root-y
Type int16.
root
Type window.

pointer-position window Function
     
window
A window specifying the coordinate system for the returned position.

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.

x
Type int16.
y
Type int16.
same-screen-p
Type boolean.
child
Type window or null.

motion-events window &key :start :stop (:result-type 'list) Function
     
window
The window containing the returned motion events.
:start, :stop
timestamp values for the time interval for returned motion events.
:result-type
The form of the returned motion events.

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.

motion-events
Type (repeat-seq (int16 x) (int16 y) (timestamp time)).

warp-pointer destination destination-x destination-y Function
     
destination
The window into which the pointer is moved.
destination-x, destination-y
The new position of the pointer relative to the destination.

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
     
display
A display.
x-offset, y-offset
The offsets used to adjust the pointer position.

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
     
destination
The window into which the pointer is moved.
destination-x, destination-y
The new position of the pointer relative to the destination .
source
The window that must currently contain the pointer.
source-x, source-y, source-width, source-height
The source rectangle that must currently contain the pointer.

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
     
x-offset, y-offset
The offsets used to adjust the pointer position.
source
The window that must currently contain the pointer.
source-x, source-y, source-width, source-height
The source rectangle that must currently contain the pointer.

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.


Next Prev Up
© 1988, 1989 Texas Instruments Incorporated
Conversion to HTML made by Gilbert Baumann.
Last build: Tue Dec 16 23:30:42 1997