Jump to content

UniTranslateKey: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
No edit summary
Line 3: Line 3:


=== Parameters ===
=== Parameters ===
; kbHndl - [[OS2 API:DataType:KHAND|KHAND]] - input : The keyboard handle created from [[OS2_API:UniCreateKeyboard|UniCreateKeyboard]].
; kbHndl - [[KHAND]] - input : The keyboard handle created from [[OS2_API:UniCreateKeyboard|UniCreateKeyboard]].
; effShift - [[OS2 API:DataType:ULONG|ULONG]] - input : The effective shift state returned from [[OS2 API:UniUpdateShiftState|UniUpdateShiftState]].
; effShift - [[ULONG]] - input : The effective shift state returned from [[OS2 API:UniUpdateShiftState|UniUpdateShiftState]].
; vScan - [[OS2 API:DataType: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 - [[OS2 API:DataType:UniChar|UniChar]] - output : The Unicode character returned.
; uc - [[UniChar]] - output : The Unicode character returned.
; vdKey - [[OS2 API:DataType:VDKEY|VDKEY]] - output : The virtual/dead key.
; vdKey - [[VDKEY]] - output : The virtual/dead key.
; biosScan - [[OS2 API:DataType:BYTE|BYTE]] - output : The BIOS scan code.
; biosScan - [[BYTE]] - output : The BIOS scan code.


=== Constants ===
=== Constants ===
Line 17: Line 17:
* [[OS2 API:Unicode:error#ULS_BADHANDLE|ULS_BADHANDLE]]
* [[OS2 API:Unicode:error#ULS_BADHANDLE|ULS_BADHANDLE]]
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]]
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]]
=== Module ===
=== Define (C/C++) ===
=== Export name/Ordinal ===


=== Calling conversion ===
=== Calling conversion ===
Line 28: Line 22:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:KHAND|KHAND]]   kbHndl;
  KHAND  kbHndl;
  [[OS2 API:DataType:ULONG|ULONG]]   effShift;
  ULONG  effShift;
  [[OS2 API:DataType:VSCAN|VSCAN]]   vScan;
  VSCAN  vScan;
  [[OS2 API:DataType:UniChar|UniChar]] uc;
  UniChar uc;
  [[OS2 API:DataType:VDKEY|VDKEY]]   vdKey;
  VDKEY  vdKey;
  [[OS2 API:DataType:BYTE|BYTE]]   biosScan;
  BYTE    biosScan;
  integer rc;
  integer rc;
  ...
  ...
Line 40: Line 34:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:UniTranslateDeadKey|UniTranslateDeadKey]]
*[[UniTranslateDeadKey]]
[[OS2 API:UniUntranslateKey|UniUntranslateKey]]
*[[UniUntranslateKey]]


=== Notes ===
=== Notes ===
Line 51: Line 45:
OS/2 Warp
OS/2 Warp


[[Category:The OS/2 API Project]]
[[Category:Uni]]

Revision as of 17:11, 25 November 2016

UniTranslateKey

UniTranslateKey(kbHndl, effShift, vScan, uc, vdKey, biosScan)
Translates a scan code and the effective shift state to a Unicode and virtual/dead key. It also sets the BIOS scan code.

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:

Calling conversion

Cdecl32

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