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.
KbdSetStatus (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_KBD
 
USHORT KbdSetStatus(pkbstKbdInfo, hkbd)
PKBDINFO pkbstKbdInfo;    /* pointer to structure for keyboard status */
HKBD hkbd;                /* keyboard handle                          */
 
The KbdSetStatus function sets the status for the specified logical
keyboard. The keyboard status specifies the state of the keyboard echo mode,
input mode, turnaround character, interim character flags, and shift state.
 
The KbdSetStatus function is a family API function.
 
Parameter     Description
────────────────────────────────────────────────────────────────────────────
 
pkbstKbdInfo  Points to the KBDINFO structure that contains the keyboard
              status.
 
hkbd          Identifies the logical keyboard. 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_INVALID_ECHO_MASK
     ERROR_KBD_INVALID_HANDLE
     ERROR_KBD_INVALID_INPUT_MASK
     ERROR_KBD_INVALID_LENGTH
 
Comments
 
In most cases, a shift key is pressed in combination with other keys to
create a single keystroke. In binary mode with shift report turned on, a
shift key by itself creates a keystroke that the KbdCharIn or KbdPeek
function can retrieve.
 
Restrictions
 
In real mode, the following restrictions apply to the KbdSetStatus
function:
 
♦  Interim and turnaround characters are not supported.
 
♦  Binary mode with echo mode on is not supported.
 
♦  ASCII mode with echo mode off is not supported.
 
♦  The hkbd parameter is ignored.
 
Example
 
This example retrieves the current status of the default keyboard, masks the
ASCII-mode bit, uses the OR operator to set the binary-mode bit, and calls
the KbdSetStatus function to change the keyboard status to binary mode:
 
KBDINFO kbstInfo;
kbstInfo.cb = sizeof(kbstInfo);
KbdGetStatus(&kbstInfo, 0);        /* gets current status  */
kbstInfo.fsMask =
    (kbstInfo.fsMask & 0x00F7)     /* masks out ASCII mode */
    | 0x0004;                      /* OR into binary mode  */
KbdSetStatus(&kbstInfo, 0);        /* sets new status      */
 
See Also
 
KbdCharIn, KbdGetStatus, KbdOpen, KbdPeek, KBDINFO