KbdXlate: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:KbdXlate to KbdXlate |
DO NOT REMOVE KNOWLEDGE |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Translates scan codes with shift states into ASCII codes. | Translates scan codes with shift states into ASCII codes. | ||
==Syntax== | ==Syntax== | ||
KbdXlate(pKey, hkbd) | |||
==Parameters== | |||
;pKey (P[[KBDKEYINFO]]) - in/out: Pointer to character data. | |||
:A pointer to a KBDKEYINFO structure containing character data. | |||
;hkbd ([[HKBD]]) - input: Reserved. Must be 0. | |||
==Return Code== | |||
;rc (APIRET) - returns:KbdXlate returns one of the following values: | |||
* 0 - NO_ERROR | |||
* 376 - ERROR_KDB_INVALID_LENGTH | |||
* 439 - ERROR_KBD_INVALID_HANDLE | |||
* 445 - ERROR_KBD_FOCUS_REQUIRED | |||
* 447 - ERROR_KBD_KEYBOARD_BUSY | |||
* 504 - ERROR_KBD_EXTENDED_SG | |||
==Sample== | |||
<PRE> | <PRE> | ||
#define INCL_KBD | #define INCL_KBD | ||
Line 13: | Line 29: | ||
rc = KbdXlate(pKey, hkbd); | rc = KbdXlate(pKey, hkbd); | ||
</PRE> | </PRE> | ||
==Remarks== | ==Remarks== |
Latest revision as of 15:32, 8 June 2018
Translates scan codes with shift states into ASCII codes.
Syntax
KbdXlate(pKey, hkbd)
Parameters
- pKey (PKBDKEYINFO) - in/out
- Pointer to character data.
- A pointer to a KBDKEYINFO structure containing character data.
- hkbd (HKBD) - input
- Reserved. Must be 0.
Return Code
- rc (APIRET) - returns
- KbdXlate returns one of the following values:
- 0 - NO_ERROR
- 376 - ERROR_KDB_INVALID_LENGTH
- 439 - ERROR_KBD_INVALID_HANDLE
- 445 - ERROR_KBD_FOCUS_REQUIRED
- 447 - ERROR_KBD_KEYBOARD_BUSY
- 504 - ERROR_KBD_EXTENDED_SG
Sample
#define INCL_KBD #include <os2.h> PKBDKEYINFO pKey; /* Pointer to character data. */ HKBD hkbd; /* Reserved. Must be 0. */ APIRET rc; /* Return code. */ rc = KbdXlate(pKey, hkbd);
Remarks
KbdXlate is designed for conditions where the scan codes are known, but not the character. This must be used with care, and is not designed to be a substitute for the normal OS/2 keyboard translation functions.
The bNlsShift member of KBDKEYINFO must be maintained from call to call whenever an interim bit is set.