subcalls.hlp (Topic list)
KbdFlushBuffer (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_KBD
 
USHORT KbdFlushBuffer(hkbd)
HKBD hkbd;    /* keyboard handle */
 
The KbdFlushBuffer function removes all keystroke information from the input
buffer of the specified logical keyboard, but only if the keyboard has the
focus or is the default keyboard.
 
The KbdFlushBuffer function is a family API function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hkbd       Identifies the logical keyboard to clear. The handle must have
           been created previously by using the KbdOpen function.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_KBD_DETACHED
     ERROR_KBD_INVALID_HANDLE
 
Restrictions
 
In real mode, the following restriction applies to the KbdFlushBuffer
function:
 
♦  The hkbd parameter is ignored.
 
Example
 
This example opens a logical keyboard and calls KbdFlushBuffer to remove any
keystrokes from the input buffer:
 
HKBD hkbd;
KbdOpen(&hkbd);
    .
    .
    .
KbdFlushBuffer(hkbd);
 
See Also
 
KbdCharIn, KbdOpen