This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call gets the current state of the keyboard.
KbdGetStatus (StatData, KbdHandle)
Bit | Description |
---|---|
15-9 | Reserved, set to zero. |
8 | Shift return is on. |
7 | Length of the turn-around character (meaningful only if bit 6 is on). |
6 | Turn-around character is modified. |
5 | Interim character flags are modified. |
4 | Shift state is modified. |
3 | ASCII mode is on. |
2 | Binary mode is on. |
1 | Echo off. |
0 | Echo on. |
Bit | Description |
---|---|
15-8 | NLS shift state. |
7 | Interim character flag is on. |
6 | Reserved, set to zero. |
5 | Application requested immediate conversion. |
4-0 | Reserved, set to zero. |
Bit | Description |
---|---|
15 | SysReq key down |
14 | CapsLock key down |
13 | NumLock key down |
12 | ScrollLock key down |
11 | Right Alt key down |
10 | Right Ctrl key down |
9 | Left Alt key down |
8 | Left Ctrl key down |
7 | Insert on |
6 | CapsLock on |
5 | NumLock on |
4 | ScrollLock on |
3 | Either Alt key down |
2 | Either Ctrl key down |
1 | Left Shift key down |
0 | Right Shift key down |
rc (USHORT) - return
Return code descriptions are:
The initial state of the keyboard is established by the system at application load time. Some default states may be modified by the application through KbdSetStatus. KbdGetStatus returns only those keyboard parameters initially set by KbdSetStatus. The returned parameters are:
KbdGetStatus completes only when the handle has access to the physical keyboard (focus) or the handle is 0 and no other handle has the focus.
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restrictions apply to KbdGetStatus when coding in the DOS mode:
typedef struct _KBDINFO { /* kbst */ USHORT cb; /* length in bytes of this structure */ USHORT fsMask; /* bit mask of functions to be altered */ USHORT chTurnAround; /* define TurnAround character */ USHORT fsInterim; /* interim character flags */ USHORT fsState; /* shift states */ }KBDINFO; #define INCL_KBD USHORT rc = KbdGetStatus(Structure, KbdHandle); PKBDINFO Structure; /* Data structure */ HKBD KbdHandle; /* Keyboard handle */ USHORT rc; /* return code */
KBDINFO struc kbst_cb dw ? ;length in bytes of this structure kbst_fsMask dw ? ;bit mask of functions to be altered kbst_chTurnAround dw ? ;define TurnAround character kbst_fsInterim dw ? ;interim character flags kbst_fsState dw ? ;shift states KBDINFO ends EXTRN KbdGetStatus:FAR INCL_KBD EQU 1 PUSH@ OTHER Structure ;Data structure PUSH WORD KbdHandle ;Keyboard handle CALL KbdGetStatus Returns WORD
This text based on http://www.edm2.com/index.php/KbdGetStatus_(FAPI)