KbdSetStatus (FAPI): Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;StatData ( | ;StatData (P[[KBDINFO]]) - input: Address of the keyboard status structure | ||
;KbdHandle ([[HKBD]]) - input : Default keyboard or the logical keyboard. | ;KbdHandle ([[HKBD]]) - input : Default keyboard or the logical keyboard. | ||
==Return Code== | ==Return Code== | ||
;rc (USHORT) - return:Return code descriptions are: | |||
Return code descriptions are: | *0 NO_ERROR | ||
* 0 | *376 ERROR_KBD_INVALID_LENGTH | ||
* 376 | *377 ERROR_KBD_INVALID_ECHO_MASK | ||
* 377 | *378 ERROR_KBD_INVALID_INPUT_MASK | ||
* 378 | *439 ERROR_KBD_INVALID_HANDLE | ||
* 439 | *445 ERROR_KBD_FOCUS_REQUIRED | ||
* 445 | *447 ERROR_KBD_KEYBOARD_BUSY | ||
* 447 | *464 ERROR_KBD_DETACHED | ||
* 464 | *504 ERROR_KBD_EXTENDED_SG | ||
* 504 | |||
==Remarks== | ==Remarks== | ||
Line 74: | Line 33: | ||
* Turnaround character is not supported. | * Turnaround character is not supported. | ||
== | ==Bindings== | ||
===C | ===C=== | ||
<PRE> | <PRE> | ||
typedef struct _KBDINFO { | typedef struct _KBDINFO { /* kbst */ | ||
USHORT cb; | USHORT cb; /* length in bytes of this structure */ | ||
USHORT fsMask; | USHORT fsMask; /* bit mask of functions to be altered */ | ||
USHORT chTurnAround; | USHORT chTurnAround; /* define TurnAround character */ | ||
USHORT fsInterim; | USHORT fsInterim; /* interim character flags */ | ||
USHORT fsState; | USHORT fsState; /* shift states */ | ||
}KBDINFO; | }KBDINFO; | ||
Line 89: | Line 48: | ||
USHORT rc = KbdSetStatus(Structure, KbdHandle); | USHORT rc = KbdSetStatus(Structure, KbdHandle); | ||
PKBDINFO | PKBDINFO Structure; /* Data structure */ | ||
HKBD | HKBD KbdHandle; /* Keyboard Handle */ | ||
USHORT | USHORT rc; /* return code */ | ||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
KBDINFO struc | KBDINFO struc | ||
Line 114: | Line 73: | ||
Returns WORD | Returns WORD | ||
</PRE> | </PRE> | ||
[[Category:Kbd]] | [[Category:Kbd]] |
Latest revision as of 18:16, 11 December 2019
This call sets the characteristics of the keyboard.
Syntax
KbdSetStatus (StatData, KbdHandle)
Parameters
- StatData (PKBDINFO) - input
- 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
- 377 ERROR_KBD_INVALID_ECHO_MASK
- 378 ERROR_KBD_INVALID_INPUT_MASK
- 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
Shift return (bit 8 in sysstate) must be disabled in ASCII mode.
KbdSetStatus is ignored for a Vio-windowed application.
Family API Considerations
Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restrictions apply to KbdSetStatus when coding in the DOS mode:
- KbdSetStatus does not accept a bit mask of 10 (ASCII on, Echo Off).
- Raw (binary) Mode and Echo On are not supported and return an error if requested.
- KbdHandle is ignored.
- Interim character is not supported.
- Turnaround character is not supported.
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 = KbdSetStatus(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 KbdSetStatus:FAR INCL_KBD EQU 1 PUSH@ OTHER Structure ;Data structure PUSH WORD KbdHandle ;Keyboard Handle CALL KbdSetStatus Returns WORD