Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

KbdXlate

This call translates scan codes with shift states into ASCII codes.

Syntax

KbdXlate (XlateRecord, KbdHandle)

Parameters

Return Code

rc (USHORT) - return:Return code descriptions are:

Remarks

It may take several calls to complete a translation because of accent key combinations, or other complex operations.

The Xlatestate1 and Xlatestate2 are for use by the keyboard translation routines. These fields are reserved and must only be accessed by the caller prior to starting a translation sequence and then they must be set to zero. The KbdXlate function is intended to be used for translating a particular scan code for a given shift state. The KbdXlate function is not intended to be a replacement for the OS/2 system keystroke translation function.

Bindings

C

typedef struct _KBDTRANS { /* kbxl */
  UCHAR      chChar;       /* ASCII character code */
  UCHAR      chScan;       /* Scan code */
  UCHAR      fbStatus;     /* State of the character */
  UCHAR      bNlsShift;    /* Shift status (reserved set to zero) */
  USHORT     fsState;      /* Shift state */
  ULONG      time;
  USHORT     fsDD;
  USHORT     fsXlate;
  USHORT     fsShift;
  USHORT     sZero;
} KBDTRANS;
 
#define INCL_KBD
 
USHORT  rc = KbdXlate(XlateRecord, KbdHandle);
 
PKBDTRANS  XlateRecord;   /* Translation Record */
HKBD       KbdHandle;     /* Keyboard handle */
 
USHORT     rc;            /* return code */

MASM

KBDTRANS struc
  kbxl_chChar    db  ? ;ASCII character code
  kbxl_chScan    db  ? ;scan code
  kbxl_fbStatus  db  ? ;State of the character
  kbxl_bNlsShift db  ? ;shift status (reserved set to zero)
  kbxl_fsState   dw  ? ;shift state
  kbxl_time      dd  ?
  kbxl_fsDD      dw  ?
  kbxl_fsXlate   dw  ?
  kbxl_fsShift   dw  ?
  kbxl_sZero     dw  ?
KBDTRANS ends
 
EXTRN  KbdXlate:FAR
INCL_KBD            EQU 1
 
PUSH@  OTHER   XlateRecord   ;Translation Record
PUSH   WORD    KbdHandle     ;Keyboard handle
CALL   KbdXlate
 
Returns WORD