Jump to content

KbdSetCustXt: Difference between revisions

From EDM2
Created page with "==Description== This call installs, on the specified handle, the translate table which this call points to. This translate table affects only this handle. ==Syntax== <PRE> Kb..."
 
Ak120 (talk | contribs)
m minor fix
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call installs, on the specified handle, the translate table which this call points to. This translate table affects only this handle.
This call installs, on the specified handle, the translate table which this call points to. This translate table affects only this handle.
==Syntax==
==Syntax==
<PRE>
  KbdSetCustXt (Xlatetable, KbdHandle)
  KbdSetCustXt
 
    (Xlatetable, KbdHandle)
</PRE>


==Parameters==
==Parameters==
; Xlatetable (PUSHORT) - input : A pointer to the translation table used to translate scan code to ASCII code for a specified handle. The format of the translate table is documented in the Set Code Page IOCTL 50H. Refer to IBM Operating System/2 Version 1.2 I/O Subsystems And Device Support Volume 1 for a complete discussion of Set Code Page IOCTL 50H.  
;Xlatetable (PUSHORT) - input : A pointer to the translation table used to translate scan code to ASCII code for a specified handle. The format of the translate table is documented in the Set Code Page IOCTL 50H. Refer to ''IBM Operating System/2 Version 1.2 I/O Subsystems and Device Support Volume 1'' for a complete discussion of Set Code Page IOCTL 50H.
 
;KbdHandle (HKBD) - input : Default keyboard or the logical keyboard.
; KbdHandle (HKBD) - input : Default keyboard or the logical keyboard.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
* 0 NO_ERROR
Return code descriptions are:
* 377 ERROR_KBD_INVALID_ECHO_MASK
 
* 378 ERROR_KBD_INVALID_INPUT_MASK
* 0   NO_ERROR  
* 439 ERROR_KBD_INVALID_HANDLE
* 377       ERROR_KBD_INVALID_ECHO_MASK  
* 445 ERROR_KBD_FOCUS_REQUIRED
* 378       ERROR_KBD_INVALID_INPUT_MASK  
* 447 ERROR_KBD_KEYBOARD_BUSY
* 439       ERROR_KBD_INVALID_HANDLE  
* 464 ERROR_KBD_DETACHED
* 445       ERROR_KBD_FOCUS_REQUIRED  
* 504 ERROR_KBD_EXTENDED_SG
* 447       ERROR_KBD_KEYBOARD_BUSY  
* 464       ERROR_KBD_DETACHED  
* 504       ERROR_KBD_EXTENDED_SG


==Remarks==
==Remarks==
The translate table must be maintained in the caller's memory. No copy of the translate table is made by KbdSetCustXt.
The translate table must be maintained in the caller's memory. No copy of the translate table is made by KbdSetCustXt.


KbdSetCp reverses the action of KbdSetCustXt and sets the handle equal to one of the system translate tables. If memory is dynamically allocated by the caller for the translate table and is freed before the KbdSetCp is performed, KbdSetCp and future translations may fail.  
[[KbdSetCp]] reverses the action of KbdSetCustXt and sets the handle equal to one of the system translate tables. If memory is dynamically allocated by the caller for the translate table and is freed before the KbdSetCp is performed, KbdSetCp and future translations may fail.


==Example Code==
==Bindings==
=== C Binding===
=== C ===
<PRE>
<PRE>
#define INCL_KBD
#define INCL_KBD
Line 39: Line 31:
USHORT  rc = KbdSetCustXt(Xlatetable, KbdHandle);
USHORT  rc = KbdSetCustXt(Xlatetable, KbdHandle);


PUSHORT         Xlatetable;    /* Translation Table */
PUSHORT Xlatetable;    /* Translation Table */
HKBD             KbdHandle;    /* Keyboard handle */
HKBD   KbdHandle;    /* Keyboard handle */


USHORT           rc;            /* return code */
USHORT rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  KbdSetCustXt:FAR
EXTRN  KbdSetCustXt:FAR
Line 57: Line 49:
</PRE>
</PRE>


==Related Functions==
[[Category:Kbd]]
*
 
[[Category:The OS/2 API Project]]

Latest revision as of 16:30, 3 January 2019

This call installs, on the specified handle, the translate table which this call points to. This translate table affects only this handle.

Syntax

KbdSetCustXt (Xlatetable, KbdHandle)

Parameters

Xlatetable (PUSHORT) - input
A pointer to the translation table used to translate scan code to ASCII code for a specified handle. The format of the translate table is documented in the Set Code Page IOCTL 50H. Refer to IBM Operating System/2 Version 1.2 I/O Subsystems and Device Support Volume 1 for a complete discussion of Set Code Page IOCTL 50H.
KbdHandle (HKBD) - input
Default keyboard or the logical keyboard.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 377 ERROR_KBD_INVALID_ECHO_MASK
  • 378 ERROR_KBD_INVALID_INPUT_MASK
  • 439 ERROR_KBD_INVALID_HANDLE
  • 445 ERROR_KBD_FOCUS_REQUIRED
  • 447 ERROR_KBD_KEYBOARD_BUSY
  • 464 ERROR_KBD_DETACHED
  • 504 ERROR_KBD_EXTENDED_SG

Remarks

The translate table must be maintained in the caller's memory. No copy of the translate table is made by KbdSetCustXt.

KbdSetCp reverses the action of KbdSetCustXt and sets the handle equal to one of the system translate tables. If memory is dynamically allocated by the caller for the translate table and is freed before the KbdSetCp is performed, KbdSetCp and future translations may fail.

Bindings

C

#define INCL_KBD

USHORT  rc = KbdSetCustXt(Xlatetable, KbdHandle);

PUSHORT Xlatetable;    /* Translation Table */
HKBD    KbdHandle;     /* Keyboard handle */

USHORT  rc;            /* return code */

MASM

EXTRN  KbdSetCustXt:FAR
INCL_KBD            EQU 1

PUSH@  WORD    CodePage      ;Translation Table
PUSH   WORD    KbdHandle     ;Keyboard handle
CALL   KbdSetCustXt

Returns WORD