KbdGetStatus (FAPI): Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:KbdGetStatus to KbdGetStatus (FAPI) |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
This call gets the current state of the keyboard. | This call gets the current state of the keyboard. | ||
==Syntax== | ==Syntax== | ||
KbdGetStatus (StatData, KbdHandle) | |||
KbdGetStatus | |||
===Parameters=== | |||
;StatData (P[[KBDINFO]]) - output : Address of the keyboard status structure | |||
;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== | ==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: | 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 | |||
* Input Mode | * Interim Character Flags | ||
* Interim Character Flags | * Shift State | ||
* Shift State | * Echo State | ||
* Echo State | * Turnaround Character | ||
* 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. | 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=== | ===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: | 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 | |||
* Interim character is not supported | * TurnAround character is not supported | ||
* TurnAround character is not supported | * NLS_SHIFT_STATE is always NULL. | ||
* NLS_SHIFT_STATE is always NULL. | |||
* KbdHandle is ignored. | * KbdHandle is ignored. | ||
== | ==Bindings== | ||
===C | ===C=== | ||
<PRE> | <PRE> | ||
typedef struct _KBDINFO { /* kbst */ | typedef struct _KBDINFO { /* kbst */ | ||
Line 119: | Line 55: | ||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
KBDINFO struc | KBDINFO struc | ||
Line 138: | Line 74: | ||
Returns WORD | Returns WORD | ||
</PRE> | </PRE> | ||
[[Category: | [[Category:Kbd]] |
Latest revision as of 12:56, 29 February 2020
This call gets the current state of the keyboard.
Syntax
KbdGetStatus (StatData, KbdHandle)
Parameters
- StatData (PKBDINFO) - output
- Address of the keyboard status structure
- 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.
Bindings
C
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 */
MASM
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