The CURSOR procedure is used to read the position of the interactive graphics cursor from the current graphics device. Note that not all graphics devices have interactive cursors. CURSOR enables the graphic cursor on the device and optionally waits for the operator to position it. On devices that have a mouse, CURSOR normally waits until a mouse button is pressed (or already down). If no mouse buttons are present, CURSOR waits for a key on the keyboard to be pressed.
The system variable !MOUSE is set to the button status. Each mouse button is assigned a bit in !MOUSE, bit 0 is the left most button, bit 1 the next, etc. See for details.
Note that the CURSOR procedure is only for use with IDL graphics windows. It should not be used with draw widgets. To obtain the cursor position and button state information from a draw widget, examine the X, Y, PRESS, and RELEASE fields in the structures returned by the draw widget in response to cursor events.
Note that for the CURSOR procedure to work properly with Tektronix terminals, you may need to execute the command,
DEVICE, GIN_CHARS=6
.
An integer that specifies the conditions under which CURSOR returns. This parameter can be used interchangeably with the keyword parameters listed below that specify the type of wait. The default value is 1. The table below describes each type of wait.
Note that not all modes of waiting work with all display devices.
Return if a button is pressed, released, or the pointer is moved. |
||
Set this keyword to wait for pointer movement or button transition within the currently selected window.
Activate the graphics cursor, select a point in the graphics window, and return the position of the cursor in device coordinates. Enter:
Move the cursor over the graphics window and press the mouse button. The position of the cursor in device coordinates is stored in the variables X and Y. To label the location, enter:
RDPIX , TVCRS , CURSOR_CROSSHAIR (and other CURSOR_ keywords), WIDGET_DRAW ,