C++
int acedGrRead( int track, int * type, struct resbuf * result );
File
acedads.h
Description
Input devices directly read the next input that the user provides to any AutoCAD input device.
Note Only specialized ARX applications need this function. The various user input functions (acedGetXxx(), acedEntSel(), acedNEntSelP(), acedNEntSel(), and acedDragGen()) are sufficient for almost all purposes.
The following list describes the control bits.
Returns drag mode coordinates. If this bit is set and the user moves the pointing device instead of selecting a button or pressing a key, acedGrRead() sets type to 5 and sets result to the (X,Y) coordinates of the current pointing-device location.
Returns all key values, including function and cursor key codes, and doesn't move the cursor when the user presses a cursor key.
The values of non-ASCII keys are platform dependent.Bit 2 (= 4 if set)Uses the value passed in the type argument to control the cursor display. There are three options:
- type = 0--Displays the normal crosshairs
- type = 1--Doesn't display a cursor (or crosshairs)
- type = 2--Displays the entity-selection target cursor
Note The acedGrRead() function sets the value of type when it returns, so if you want to control the cursor display over a series of acedGrRead() calls, you must reset type at each call.
Doesn't display the error: console break message when the user presses [Esc].
Note Prior to AutoCAD Release 12, the track argument was true (nonzero) or false (0), and acedGrRead() disregarded the initial value of type (if any). The change in the type argument should have no impact, but if you have an existing application that calls acedGrRead(), check to make sure that whenever the track argument is true, it is set to 1. Any other true (nonzero) value of track can lead to unexpected behavior. Also, bear in mind that additional control bits may be defined in future AutoCAD releases.
The possible type return values, their meanings, and the associated result-buffer contents are shown in the following table.
Return values from acedGrRead:
type Value | Type of Input | result Value | Description |
---|---|---|---|
2 | Keyboard input | Varies | Character code |
3 | Selected point | 3D point | Point coordinates |
4 | Screen/pull-down menu item (from pointing device) | 0 to 9991,001 to 1,9992,001 to 2,9993,001 to 3,999... and so, to16,001 to 16,999 | Screen menu box numberPOP1 menu box numberPOP2 menu box numberPOP3 menu box number... and so, toPOP16 menu box number |
5 | Pointing device (returned only if tracking is enabled) | 3D point | Drag mode coordinate |
6 | BUTTONS menu item | 0 to 9991,000 to 1,9992,000 to 2,9993,000 to 3,999 | BUTTONS1 menu button numberBUTTONS2 menu button numberBUTTONS3 menu button numberBUTTONS4 menu button number |
7 | TABLET1 menu item | 0 to 32,767 | Digitized box number |
8 | TABLET2 menu item | 0 to 32,767 | Digitized box number |
9 | TABLET3 menu item | 0 to 32,767 | Digitized box number |
10 | TABLET4 menu item | 0 to 32,767 | Digitized box number |
11 0 to 999 | AUX menu item | 0 to 9991,000 to 1,9992,000 to 2,9993,000 to 3,999 | AUX1 menu button numberAUX2 menu button numberAUX3 menu button numberAUX4 menu button number |
12 | Pointer button (follows a type 6 or type 11 return) | 3D point | Point coordinates |
If the user presses the pointer button within a screen menu or pull-down menu box, acedGrRead() returns a type 6 or type 11 code, but in a subsequent call, it does not return a type 12 code. The type 12 code follows type 6 or type 11 only when the pointer button is pressed while it is in the graphics area of the screen.
If the user presses [Esc] during a call to acedGrRead(), it displays the message error: console break and returns RTCAN (unless bit 3 of the track argument has been set to disable console breaks). Any other user input is returned in type and result, and must be handled by the ARX application.
Unless a critical error or a user cancellation (RTCAN) or a modeless interrupt signal occurs, acedGrRead() returns RTNORM. It returns RTMODELESS, if the active command was registered using the ACRX_CMD_INTERRUPTIBLE flag and the document has received a modeless interrupt signal from a call to AcApDocManager::sendModelessInterrupt().
Parameters
Parameters | Description |
---|---|
track | Control bits that affect the behavior of acedGrRead(); not mutually exclusive, so to set multiple conditions add the values together |
type | Device and kind of input entered; used to control the cursor display |
result | Output value obtained from the user |