ioctl12.hlp (Topic list)
KBD_READCHAR (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSDEVIOCTL
 
USHORT DosDevIOCtl(pkkiBuffer, pcRecords, 0x0074, 0x0004, hDevice)
PKBDKEYINFO pkkiBuffer;    /* pointer to structure for keystrokes     */
PUSHORT pcRecords;         /* pointer to variable for record count    */
HFILE hDevice;             /* device handle                           */
 
The KBD_READCHAR function retrieves one or more character data records from
the keyboard-input buffer for the screen group of the active process.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
pkkiBuffer  Points to the structure that receives the character data
            records. The structure must be at least as large as the size of
            an individual record multiplied by the requested number of
            records to be read.
 
pcRecords   Points to the variable that contains the number of records to be
            read. When the function returns, it copies the actual number of
            records retrieved to the variable.
 
hDevice     Identifies the keyboard that receives the device-control
            function. The handle must have been created previously by using
            the DosOpen function.
 
Return Value
 
The return value is zero if the function is successful or an error value if
an error occurs.
 
Comments
 
This function copies the records to the buffer pointed to by the pkkiBuffer
parameter. The variable pointed to by the pcRecords parameter specifies the
number of records to copy. The function can copy up to 16 characters.
 
If the variable pointed to by pcRecords is KBD_READ_WAIT, the function waits
for the requested number of keystrokes; it blocks the calling process until
all records have been read. If the variable is KBD_READ_NOWAIT, the function
retrieves any available records (up to the specified number) and returns
immediately. When the function returns, it copies the actual number of
records retrieved to the variable. It sets the sign bit to 0 if the input
mode is ASCII; it sets the sign bit to 1 (0x8000) if the input mode is
binary.
 
See Also
 
DosOpen, KbdCharIn, KBD_PEEKCHAR, KBDKEYINFO