xclick

xclick — wait for a mouse click

Calling sequence

[c_i,c_x,c_y,c_w,c_m]=xclick([flag])  

Parameters

c_i : integer, mouse button number.
c_x,c_y : real scalars, position of the mouse.
c_w : integer, window number.
c_m : string, menu callback.
flag : integer. If present, the click event queue is not cleared when entering xclick.

Description

xclick waits for a mouse click in the graphics window.

If it is called with 3 left hand side arguments, it waits for a mouse click in the current graphics window.

If it is called with 4 or 5 left hand side arguments, it waits for a mouse click in any graphics window.

The returned values are described below.

c_i: an integer which gives the number of the mouse button that was pressed 0, 1 or 2 (for left, middle and right) or -1 in case of problems with xclick.
c_x,c_y: the coordinates of the position of the mouse click in the current graphics scale.
c_w: the window number where the click has occurred.
c_m: string associated with a dynamic menu. If xclick returns due to a click on a menu, c_i, c_x, c_y, and c_w take arbitrary values.

Known troubles

xclick can return the message "Can't grab the pointer" if the graphics window is iconified when calling it.

See also

locate, xgetmouse

Author

J.Ph.C.