Jump to content

KbdSetCp: Difference between revisions

From EDM2
m Martini moved page OS2 API:KbdSetCp to OS2 API:CPI:KbdSetCp
No edit summary
Line 1: Line 1:
==Description==
This function supports the code page switching for the keyboard.  
This function supports the code page switching for the keyboard.  
It sets to an installed code page, which is loaded if necessary.
It sets to an installed code page, which is loaded if necessary.
Sets the current keyboard code page used to translate keystrokes received from the keyboard. This causes a change in the translation of keys. The code page can be any code page (except EBCDIC to DBCS). Setting this code page does not affect the display or process code pages.
==Syntax==
<PRE>
#define INCL_KBD
#include <os2.h>
ULONG    ulReserved;  /*  Reserved.  Must be 0. */
USHORT    pidCP;      /*  Code page ID. */
HKBD      hkbd;        /*  Reserved.  Must be 0. */
APIRET    rc;          /*  Return Code. */
rc = KbdSetCp(ulReserved, pidCP, hkbd);
</PRE>
==Parameters==
; ulReserved (ULONG) - input : Reserved. Must be 0.
; pidCP (USHORT) - input : Code page ID.
The code page ID must be the ID of a code page installed on the system or zero.
; hkbd (HKBD) - input :  Reserved. Must be 0.
==Return Code==
rc (APIRET) - returns
KbdSetCp returns one of the following values:
* 0      NO_ERROR
* 439    ERROR_KBD_INVALID_HANDLE 
* 445    ERROR_KBD_FOCUS_REQUIRED 
* 447    ERROR_KBD_KEYBOARD_BUSY 
* 448    ERROR_KBD_INVALID_CODEPAGE 
* 504    ERROR_KBD_EXTENDED_SG
==Remarks==
==Example Code==
<PRE>
</PRE>
==Related Functions==
* [[OS2 API:CPI:
[[Category:The OS/2 API Project]]

Revision as of 18:30, 9 June 2016

Description

This function supports the code page switching for the keyboard. It sets to an installed code page, which is loaded if necessary.

Sets the current keyboard code page used to translate keystrokes received from the keyboard. This causes a change in the translation of keys. The code page can be any code page (except EBCDIC to DBCS). Setting this code page does not affect the display or process code pages.

Syntax

#define INCL_KBD
#include <os2.h>

ULONG     ulReserved;  /*  Reserved.  Must be 0. */
USHORT    pidCP;       /*  Code page ID. */
HKBD      hkbd;        /*  Reserved.  Must be 0. */
APIRET    rc;          /*  Return Code. */

rc = KbdSetCp(ulReserved, pidCP, hkbd);

Parameters

ulReserved (ULONG) - input
Reserved. Must be 0.
pidCP (USHORT) - input
Code page ID.

The code page ID must be the ID of a code page installed on the system or zero.

hkbd (HKBD) - input
Reserved. Must be 0.

Return Code

rc (APIRET) - returns

KbdSetCp returns one of the following values:

  • 0 NO_ERROR
  • 439 ERROR_KBD_INVALID_HANDLE
  • 445 ERROR_KBD_FOCUS_REQUIRED
  • 447 ERROR_KBD_KEYBOARD_BUSY
  • 448 ERROR_KBD_INVALID_CODEPAGE
  • 504 ERROR_KBD_EXTENDED_SG

Remarks

Example Code


Related Functions

  • [[OS2 API:CPI: