UniTranslateKey: Difference between revisions
Appearance
m Ak120 moved page OS2 API:UniTranslateKey to UniTranslateKey |
mNo edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
Translates a scan code and the effective shift state to a Unicode and virtual/dead key. It also sets the BIOS scan code. | |||
=== Syntax === | |||
UniTranslateKey(kbHndl, effShift, vScan, uc, vdKey, biosScan); | |||
=== Parameters === | === Parameters === | ||
; kbHndl - [[KHAND]] - input : The keyboard handle created from [[ | ; kbHndl - [[KHAND]] - input : The keyboard handle created from [[UniCreateKeyboard]]. | ||
; effShift - [[ULONG]] - input : The effective shift state returned from [[ | ; effShift - [[ULONG]] - input : The effective shift state returned from [[UniUpdateShiftState]]. | ||
; vScan - [[VSCAN]] - input : The Presentation Manager scan code which indicates the key. This does not indicate any action keys like break, repeat, make, etc. | ; vScan - [[VSCAN]] - input : The Presentation Manager scan code which indicates the key. This does not indicate any action keys like break, repeat, make, etc. | ||
; uc - [[UniChar]] - output : The Unicode character returned. | ; uc - [[UniChar]] - output : The Unicode character returned. | ||
Line 15: | Line 17: | ||
=== Returns === | === Returns === | ||
An integer with values of: | An integer with values of: | ||
* | *ULS_BADHANDLE | ||
* | *ULS_SUCCESS | ||
=== Calling | === Calling Convention === | ||
[[Cdecl32]] | [[Cdecl32]] | ||
Latest revision as of 18:00, 12 March 2018
Translates a scan code and the effective shift state to a Unicode and virtual/dead key. It also sets the BIOS scan code.
Syntax
UniTranslateKey(kbHndl, effShift, vScan, uc, vdKey, biosScan);
Parameters
- kbHndl - KHAND - input
- The keyboard handle created from UniCreateKeyboard.
- effShift - ULONG - input
- The effective shift state returned from UniUpdateShiftState.
- vScan - VSCAN - input
- The Presentation Manager scan code which indicates the key. This does not indicate any action keys like break, repeat, make, etc.
- uc - UniChar - output
- The Unicode character returned.
- vdKey - VDKEY - output
- The virtual/dead key.
- biosScan - BYTE - output
- The BIOS scan code.
Constants
None
Returns
An integer with values of:
- ULS_BADHANDLE
- ULS_SUCCESS
Calling Convention
Example Code
KHAND kbHndl; ULONG effShift; VSCAN vScan; UniChar uc; VDKEY vdKey; BYTE biosScan; integer rc; ... rc = UniTranslateKey(kbHndl, effShift, vScan, uc, vdKey, biosScan); ...
Related Functions
Notes
Most of the time, there is an Unicode character or Presentation Manager (virtual) scan code. A few cases (Esc, Tab, Backspace) both will exist. It is normal, upon the return of a dead key, there is also a Unicode character for the stand-alone character associated with the dead key.
The BIOS scan code is returned due to the translation being dependent on the keyboard layout. This emulates the earlier DOS and OS/2 keyboard layouts that allow the translated (BIOS) scan code to be set by the layout.
OS Version Introduced
OS/2 Warp