subcalls.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
KbdOpen (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_KBD
 
USHORT KbdOpen(phkbd)
PHKBD phkbd;    /* pointer to variable for keyboard handle */
 
The KbdOpen function opens a logical keyboard and creates a unique handle
that identifies a logical keyboard for use in subsequent Kbd (or other MS
OS/2) functions. The KbdOpen function initializes the logical keyboard to
use the default system code page.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
phkbd      Points to the variable that receives the handle of the logical
           keyboard.
 
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_NO_MORE_HANDLE
     ERROR_KBD_CANNOT_CREATE_KCB
 
Comments
 
Any MS OS/2 function that can receive input through a handle (for example,
the DosRead function) can use the handle created by the KbdOpen function.
 
Example
 
This example calls the KbdOpen function to create and open a handle for a
logical keyboard. Before you can access this logical keyboard, you must call
the KbdGetFocus function to retrieve the focus:
 
HKBD hkbd;
KbdOpen(&hkbd);
KbdGetFocus(IO_WAIT, hkbd);
 
See Also
 
DosRead, KbdClose, KbdGetFocus