The LazyBoy Library Manual - KeyPreview

Part of the Keyboard group.

%imacro KeyPreview 1
Prefers: AX

Check the value of a possible waiting keystroke and leave it in the buffer.

When a keystroke is waiting, the Carry Flag will be set and the pending keystroke will be returned in the paramater.

If no keystrokes are waiting, then the Carry Flag will be clear and 0x0000 will be returned in the parameter.

Examples:

    KeyPreview ax          ; get next keystroke and store in AX
    KeyPreview [di]        ; get next keystroke and store it in [ds:di]

See also: KeyPressed, KeyWait and KeyRead.