no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | en:docs:fapi:kbdgetstatus [2018/08/31 15:00] – created prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This call gets the current state of the keyboard. | ||
+ | |||
+ | ==Syntax== | ||
+ | | ||
+ | |||
+ | ===Parameters=== | ||
+ | ;StatData (PKBDINFO) - output : Address of the keyboard status structure: | ||
+ | :length (USHORT) : Length, in bytes, of this data structure, including length. | ||
+ | | ||
+ | :sysstate (USHORT) : State as follows: | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | : | ||
+ | : | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | :shiftstate (USHORT) : Shift state as follows: | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ; KbdHandle (HKBD) - input : Default keyboard or the logical keyboard. | ||
+ | |||
+ | ===Return Code=== | ||
+ | rc (USHORT) - return | ||
+ | Return code descriptions are: | ||
+ | * 0 NO_ERROR | ||
+ | * 376 ERROR_KBD_INVALID_LENGTH | ||
+ | * 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== | ||
+ | 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: | ||
+ | * Input Mode | ||
+ | * Interim Character Flags | ||
+ | * Shift State | ||
+ | * Echo State | ||
+ | * Turnaround Character | ||
+ | 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. | ||
+ | |||
+ | ===Family API Considerations=== | ||
+ | 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: | ||
+ | * Interim character is not supported | ||
+ | * TurnAround character is not supported | ||
+ | * NLS_SHIFT_STATE is always NULL. | ||
+ | * KbdHandle is ignored. | ||
+ | |||
+ | ==Example Code== | ||
+ | ===C Binding=== | ||
+ | <PRE> | ||
+ | typedef struct _KBDINFO { /* kbst */ | ||
+ | USHORT cb; /* length in bytes of this structure */ | ||
+ | USHORT fsMask; | ||
+ | USHORT chTurnAround; | ||
+ | USHORT fsInterim; | ||
+ | USHORT fsState; | ||
+ | }KBDINFO; | ||
+ | |||
+ | #define INCL_KBD | ||
+ | |||
+ | USHORT | ||
+ | |||
+ | PKBDINFO | ||
+ | HKBD | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ===MASM Binding=== | ||
+ | <PRE> | ||
+ | KBDINFO struc | ||
+ | kbst_cb | ||
+ | kbst_fsMask | ||
+ | kbst_chTurnAround dw ? ;define TurnAround character | ||
+ | kbst_fsInterim | ||
+ | kbst_fsState | ||
+ | KBDINFO ends | ||
+ | |||
+ | EXTRN KbdGetStatus: | ||
+ | INCL_KBD | ||
+ | |||
+ | PUSH@ OTHER | ||
+ | PUSH | ||
+ | CALL | ||
+ | |||
+ | Returns WORD | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Note ====== | ||
+ | |||
+ | This text based on [[http:// | ||
+ | |||
+ | {{page> | ||
+ | |||