Jump to content

KbdXlate: Difference between revisions

From EDM2
Created page with "==Description== Translates scan codes with shift states into ASCII codes. ==Syntax== <PRE> #define INCL_KBD #include <os2.h> PKBDKEYINFO pKey; /* Pointer to character d..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 12: Line 12:


rc = KbdXlate(pKey, hkbd);
rc = KbdXlate(pKey, hkbd);
</PRE>


</PRE>
==Parameters==
==Parameters==
; pKey (PKBDKEYINFO) - in/out : Pointer to character data.
; pKey (PKBDKEYINFO) - in/out : Pointer to character data.
A pointer to a KBDKEYINFO structure containing character data.  
:A pointer to a KBDKEYINFO structure containing character data.  
 
; hkbd (HKBD) - input : Reserved. Must be 0.
; hkbd (HKBD) - input : Reserved. Must be 0.


Line 24: Line 23:


KbdXlate returns one of the following values:
KbdXlate returns one of the following values:
 
* 0 - NO_ERROR
* 0         NO_ERROR.
* 376 - ERROR_KDB_INVALID_LENGTH
* 376       ERROR_KDB_INVALID_LENGTH  
* 439 - ERROR_KBD_INVALID_HANDLE
* 439       ERROR_KBD_INVALID_HANDLE  
* 445 - ERROR_KBD_FOCUS_REQUIRED
* 445       ERROR_KBD_FOCUS_REQUIRED  
* 447 - ERROR_KBD_KEYBOARD_BUSY
* 447       ERROR_KBD_KEYBOARD_BUSY  
* 504 - ERROR_KBD_EXTENDED_SG
* 504       ERROR_KBD_EXTENDED_SG


==Remarks==
==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.
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.  
The bNlsShift member of KBDKEYINFO must be maintained from call to call whenever an interim bit is set.
 
==Example Code==
<PRE>
 
</PRE>
==Related Functions==
 


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

Revision as of 00:29, 3 November 2016

Description

Translates scan codes with shift states into ASCII codes.

Syntax

#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);

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

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.