Jump to content

KbdSetCp (FAPI): Difference between revisions

From EDM2
Created page with "==Description== This call allows the process to set the code page used to translate key strokes received from the keyboard. ==Syntax== <PRE> KbdSetCp (Reserved, CodePag..."
 
Ak120 (talk | contribs)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Description==
This call allows the process to set the code page used to translate key strokes received from the keyboard.
This call allows the process to set the code page used to translate key strokes received from the keyboard.


==Syntax==
==Syntax==
<PRE>
  KbdSetCp (Reserved, CodePageID, KbdHandle)
  KbdSetCp


    (Reserved, CodePageID, KbdHandle)
</PRE>
==Parameters==
==Parameters==
; Reserved (USHORT) - input : Reserved and must be set to zero.  
;Reserved (USHORT) - input: Reserved and must be set to zero.
 
;CodePageID (USHORT) - input: CodePageID represents a code-page ID in the application's data area. The code-page ID must be equivalent to one of the code-page IDs specified on the CONFIG.SYS CODEPAGE = statement or 0000. If the code-page ID does not match one of the IDs on the CODEPAGE = statement, an error results.
; CodePageID (USHORT) - input : CodePageID represents a code-page ID in the application's data area. The code-page ID must be equivalent to one of the code-page IDs specified on the CONFIG.SYS CODEPAGE = statement or 0000. If the code-page ID does not match one of the IDs on the CODEPAGE = statement, an error results. The code-page word must have one of these code-page identifiers:
:The code-page word must have one of these code-page identifiers:
 
::{|class="wikitable"
'''Identifier       Description'''
!Identifier||Description
0       Resident code page
|-
437       IBM PC US 437  
|0||Resident code page
850       Multilingual  
|-
860       Portuguese  
|437||IBM PC US 437
863       Canadian-French  
|-
865       Nordic.
|850||Multilingual
 
|-
; KbdHandle (HKBD) - input : Default keyboard or the logical keyboard.
|860||Portuguese
|-
|863||Canadian-French
|-
|865||Nordic
|}
;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:
*439 ERROR_KBD_INVALID_HANDLE
 
*445 ERROR_KBD_FOCUS_REQUIRED
* 0         NO_ERROR  
*447 ERROR_KBD_KEYBOARD_BUSY
* 439       ERROR_KBD_INVALID_HANDLE  
*448 ERROR_KBD_INVALID_CODEPAGE
* 445       ERROR_KBD_FOCUS_REQUIRED  
*464 ERROR_KBD_DETACHED
* 447       ERROR_KBD_KEYBOARD_BUSY  
*504 ERROR_KBD_EXTENDED_SG
* 448       ERROR_KBD_INVALID_CODEPAGE  
* 464       ERROR_KBD_DETACHED  
* 504       ERROR_KBD_EXTENDED_SG


==Remarks==
==Remarks==
Keyboard code page support is not available without the DEVINFO=KBD statement in the CONFIG.SYS file. Refer to IBM Operating System/2 Standard Edition Version 1.2 Using Advanced Features for a complete description of CODEPAGE and DEVINFO.  
Keyboard code page support is not available without the DEVINFO=KBD statement in the CONFIG.SYS file. Refer to IBM Operating System/2 Standard Edition Version 1.2 Using Advanced Features for a complete description of CODEPAGE and DEVINFO.  


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_KBD
#define INCL_KBD
Line 46: Line 45:
USHORT  rc = KbdSetCp(Reserved, CodePageID, KbdHandle);
USHORT  rc = KbdSetCp(Reserved, CodePageID, KbdHandle);


USHORT           Reserved;      /* Reserved (must be zero) */
USHORT Reserved;      /* Reserved (must be zero) */
USHORT           CodePageID;    /* code page ID */
USHORT CodePageID;    /* code page ID */
HKBD             KbdHandle;    /* Keyboard handle */
HKBD   KbdHandle;    /* Keyboard handle */


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


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  KbdSetCp:FAR
EXTRN  KbdSetCp:FAR
Line 65: Line 64:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


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

Latest revision as of 12:34, 29 February 2020

This call allows the process to set the code page used to translate key strokes received from the keyboard.

Syntax

KbdSetCp (Reserved, CodePageID, KbdHandle)

Parameters

Reserved (USHORT) - input
Reserved and must be set to zero.
CodePageID (USHORT) - input
CodePageID represents a code-page ID in the application's data area. The code-page ID must be equivalent to one of the code-page IDs specified on the CONFIG.SYS CODEPAGE = statement or 0000. If the code-page ID does not match one of the IDs on the CODEPAGE = statement, an error results.
The code-page word must have one of these code-page identifiers:
Identifier Description
0 Resident code page
437 IBM PC US 437
850 Multilingual
860 Portuguese
863 Canadian-French
865 Nordic
KbdHandle (HKBD) - input
Default keyboard or the logical keyboard.

Return Code

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

Remarks

Keyboard code page support is not available without the DEVINFO=KBD statement in the CONFIG.SYS file. Refer to IBM Operating System/2 Standard Edition Version 1.2 Using Advanced Features for a complete description of CODEPAGE and DEVINFO.

Bindings

C

#define INCL_KBD

USHORT  rc = KbdSetCp(Reserved, CodePageID, KbdHandle);

USHORT  Reserved;      /* Reserved (must be zero) */
USHORT  CodePageID;    /* code page ID */
HKBD    KbdHandle;     /* Keyboard handle */

USHORT  rc;            /* return code */

MASM

EXTRN  KbdSetCp:FAR
INCL_KBD            EQU 1

PUSH   WORD    Reserved      ;Reserved (must be zero)
PUSH   WORD    CodePageID    ;code page ID
PUSH   WORD    KbdHandle     ;Keyboard handle
CALL   KbdSetCp

Returns WORD