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.
KbdGetStatus (1.2)
◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_KBD
USHORT KbdGetStatus(pkbstKbdInfo, hkbd)
PKBDINFO pkbstKbdInfo; /* pointer to structure for keyboard status */
HKBD hkbd; /* keyboard handle */
The KbdGetStatus function retrieves the status of 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 KbdGetStatus function is a family API function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
pkbstKbdInfo Points to the KBDINFO structure that receives 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 the following:
ERROR_KBD_INVALID_LENGTH
ERROR_KBD_INVALID_HANDLE
Comments
Although the initial status of a logical keyboard depends on the system, the
logical keyboard typically has echo and ASCII modes turned on, and has a
single-byte turnaround character whose value corresponds to the ENTER key.
Restrictions
In real mode, the following restrictions apply to the KbdGetStatus
function:
♦ The hkbd parameter is ignored.
♦ Interim and turnaround characters are not supported.
Example
This example calls the KbdGetStatus function to retrieve the status of the
default keyboard. It then checks to see if echo mode is turned on:
KBDINFO kbstInfo;
kbstInfo.cb = sizeof(kbstInfo); /* length of status buffer */
KbdGetStatus(&kbstInfo, 0);
if (kbstInfo.fsMask & KEYBOARD_ECHO_ON) {
VioWrtTTY("Echo is on\n\r", 12, 0);
See Also
KbdSetStatus, KbdOpen, KBDINFO
♦