Jump to content

UniTranslateDeadKey: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== UniTranslateDeadKey ==
Translates a Unicode character and virtual/dead key into a composite character.
; UniTranslateDeadKey(kbHndl, vdKey, ucInChar, ucOutChar, newVDKey) : Translates a Unicode character and virtual/dead key into a composite character.
 
==Syntax==
UniTranslateDeadKey(kbHndl, vdKey, ucInChar, ucOutChar, newVDKey)


=== 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 [[UniCreateKeyboard]].
; vdKey - [[OS2 API:DataType:VDKEY|VDKEY]] - output : The virtual/dead key.
; vdKey - [[VDKEY]] - output : The virtual/dead key.
; ucInChar - [[UniChar]] - input : The second character in the sequence.
; ucInChar - [[UniChar]] - input : The second character in the sequence.
; ucOutChar - [[UniChar]] - output : The composite character.
; ucOutChar - [[UniChar]] - output : The composite character.
; newVDKey - [[OS2 API:DataType:VDKEY|VDKEY]] - output : The dead key value. For a non-zero value, the dead key is chained. OS/2 does not support chained dead keys.
; newVDKey - [[VDKEY]] - output : The dead key value. For a non-zero value, the dead key is chained. OS/2 does not support chained dead keys.


=== Constants ===
=== Constants ===
Line 14: Line 16:
=== Returns ===
=== Returns ===
An integer with values of:
An integer with values of:
* [[OS2 API:Unicode:error#ULS_BADHANDLE|ULS_BADHANDLE]]
*ULS_BADHANDLE
* [[OS2 API:Unicode:error#ULS_NODEAD|ULS_NODEAD]]
*ULS_NODEAD
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]]
*ULS_SUCCESS


=== Calling Convention ===
=== Calling Convention ===
Line 22: Line 24:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:KHAND|KHAND]]   kbHndl;
  KHAND  kbHndl;
  [[OS2 API:DataType:VDKEY|VDKEY]]   vdKey;
  VDKEY  vdKey;
  [[UniChar]] ucInChar;
  UniChar ucInChar;
  UniChar ucOutChar;
  UniChar ucOutChar;
  [[OS2 API:DataType:VDKEY|VDKEY]]   newVDKey;
  VDKEY  newVDKey;
  integer rc;
  integer rc;
  ...
  ...
Line 37: Line 39:


=== Notes ===
=== Notes ===
The calling program is expected to maintain the dead key state so that when the next dead key is found to form the full character. After the dead key translate, the dead key state needs to be reset.
The calling program is expected to maintain the dead key state so that when the next dead key is found to form the full character. After the dead key translate, the dead key state needs to be reset.


There is a provision in the table for chained dead keys, which is used in Japanese logic. It shouldn't be used as OS/2 doesn't support chained dead keys.
There is a provision in the table for chained dead keys, which is used in Japanese logic. It shouldn't be used as OS/2 doesn't support chained dead keys.


=== OS Version Introduced ===
=== OS Version Introduced ===

Latest revision as of 18:01, 12 March 2018

Translates a Unicode character and virtual/dead key into a composite character.

Syntax

UniTranslateDeadKey(kbHndl, vdKey, ucInChar, ucOutChar, newVDKey)

Parameters

kbHndl - KHAND - input
The keyboard handle created from UniCreateKeyboard.
vdKey - VDKEY - output
The virtual/dead key.
ucInChar - UniChar - input
The second character in the sequence.
ucOutChar - UniChar - output
The composite character.
newVDKey - VDKEY - output
The dead key value. For a non-zero value, the dead key is chained. OS/2 does not support chained dead keys.

Constants

None

Returns

An integer with values of:

  • ULS_BADHANDLE
  • ULS_NODEAD
  • ULS_SUCCESS

Calling Convention

Cdecl32

Example Code

KHAND   kbHndl;
VDKEY   vdKey;
UniChar ucInChar;
UniChar ucOutChar;
VDKEY   newVDKey;
integer rc;
...
rc = UniTranslateDeadKey(kbHndl, vdKey, ucInChar, ucOutChar, newVDKey);
...

Related Functions

Notes

The calling program is expected to maintain the dead key state so that when the next dead key is found to form the full character. After the dead key translate, the dead key state needs to be reset.

There is a provision in the table for chained dead keys, which is used in Japanese logic. It shouldn't be used as OS/2 doesn't support chained dead keys.

OS Version Introduced

  • OS/2 Warp