Jump to content

KbdFlushBuffer (FAPI): Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
Line 3: Line 3:


==Syntax==
==Syntax==
<PRE>
  KbdFlushBuffer (KbdHandle)
  KbdFlushBuffer


    (KbdHandle)
</PRE>
==Parameters==
==Parameters==
;  KbdHandle (HKBD) - input : Default keyboard or the logical keyboard.
;  KbdHandle (HKBD) - input : Default keyboard or the logical keyboard.
==Return Code==
==Return Code==
  rc (USHORT) - return
  rc (USHORT) - return


Return code descriptions are:
Return code descriptions are:
* 0          NO_ERROR  
* 0          NO_ERROR  
* 439        ERROR_KBD_INVALID_HANDLE  
* 439        ERROR_KBD_INVALID_HANDLE  
Line 26: Line 23:


===Family API Considerations===
===Family API Considerations===
Some options operate differently in the DOS mode than in the OS/2 mode. The KbdHandle is ignored when coding in the DOS mode.  
Some options operate differently in the DOS mode than in the OS/2 mode. The KbdHandle is ignored when coding in the DOS mode.  


Line 36: Line 32:
USHORT  rc = KbdFlushBuffer(KbdHandle);
USHORT  rc = KbdFlushBuffer(KbdHandle);


HKBD             KbdHandle;    /* Keyboard handle */
HKBD   KbdHandle;    /* Keyboard handle */
 
USHORT rc;            /* return code */
USHORT           rc;            /* return code */
</PRE>
</PRE>


Line 51: Line 46:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Kbd]]

Revision as of 22:56, 13 January 2017

Description

This call clears the keystroke buffer.

Syntax

KbdFlushBuffer (KbdHandle)

Parameters

KbdHandle (HKBD) - input
Default keyboard or the logical keyboard.

Return Code

rc (USHORT) - return

Return code descriptions are:

  • 0 NO_ERROR
  • 439 ERROR_KBD_INVALID_HANDLE
  • 445 ERROR_KBD_FOCUS_REQUIRED
  • 447 ERROR_KBD_KEYBOARD_BUSY
  • 464 ERROR_KBD_DETACHED
  • 504 ERROR_KBD_EXTENDED_SG

Remarks

KbdFlushBuffer completes when the handle has access to the physical keyboard (focus), or is equal to zero and no other handle has the focus.

Family API Considerations

Some options operate differently in the DOS mode than in the OS/2 mode. The KbdHandle is ignored when coding in the DOS mode.

Example Code

C Binding

#define INCL_KBD

USHORT  rc = KbdFlushBuffer(KbdHandle);

HKBD    KbdHandle;     /* Keyboard handle */
USHORT  rc;            /* return code */

MASM Binding

EXTRN  KbdFlushBuffer:FAR
INCL_KBD            EQU 1

PUSH   WORD    KbdHandle     ;Keyboard handle
CALL   KbdFlushBuffer

Returns WORD