Function Entry: GRREAD
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: GRREAD
Name
grread
Class
Host Function
Syntax
(grread [track] [allkeys [curtype]])
Arguments and Values
track: optional tracking flagallkeys: optional key/gesture modecurtype: optional cursor-type control
Autodesk documents allkeys as a bit-coded integer.
Description
Reads low-level graphical or keyboard input events.
Return Values
List describing the input event.
Autodesk documents that the first list element is an event type code, with the second element depending on that type.
The event is a proper two-element list (code value) — NOT a dotted pair
(code . value). For a keyboard event (code 2) the value is the character code,
so the list is e.g. (2 102); the value is (cadr result), and (cdr result)
is the one-element list (102), not the bare integer. (Observed on live
BricsCAD V26, 2026-09-08; this is the classic AutoLISP shape, easy to misread as
a dotted pair.)
clautolisp
clautolisp has no drawing editor, so it implements only the KEYBOARD case
(code 2): grread reads one character from the active host's input stream and
returns the proper list (2 CHAR-CODE). Mouse, point, tablet and other
graphical event codes are not produced; and a host with no interactive input
(batch mode, or a backend that does not support grread) returns nil rather
than signalling. track=/=allkeys=/=curtype are accepted for call-compatibility
but are inert in a terminal (no cursor, no drag tracking). A live CAD host
restores the native graphical behaviour.
Side Effects
- enters low-level input mode
- consumes input events
Compatibility
One of the most host- and UI-specific user-input functions.
Availability
- AutoCAD 2026: documented (per Autodesk reference page).
- BricsCAD V26: presumed compatible (no contradicting page found).
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [grread (AutoLISP)](https://help.autodesk.com/cloudhelp/2023/ENU/AutoCAD-AutoLISP-Reference/files/GUID-2484FFE3-95B3-4C2B-AF79-BE7772B07419.htm)
- [About Accessing and Requesting User Input (AutoLISP)](https://help.autodesk.com/cloudhelp/2024/ESP/AutoCAD-AutoLISP/files/GUID-7F024C1B-EFB8-4F6C-9EFE-A6491210A4CD.htm)
Notes
- Autodesk documents
allkeysbit values including drag-mode coordinates, all-key reporting, and cursor control. - Autodesk explicitly warns that applications using
grreadare unlikely to be upward compatible across hardware and platform configurations. - Current Autodesk reference marks
grreadas supported on Windows and macOS, not Web.