Jump to content

KbdSetCp: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 17: Line 17:
rc = KbdSetCp(ulReserved, pidCP, hkbd);
rc = KbdSetCp(ulReserved, pidCP, hkbd);
</PRE>
</PRE>
==Parameters==
==Parameters==
; ulReserved (ULONG) - input : Reserved. Must be 0.  
;ulReserved (ULONG) - input : Reserved. Must be 0.
 
;pidCP (USHORT) - input : Code page ID.
; pidCP (USHORT) - input : Code page ID.
:The code page ID must be the ID of a code page installed on the system or zero.
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.
 
; hkbd (HKBD) - input :  Reserved. Must be 0.  


==Return Code==
==Return Code==
  rc (APIRET) - returns
  rc (APIRET) - returns
KbdSetCp returns one of the following values:
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


* 0      NO_ERROR
[[Category:Kbd]]
* 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 02:22, 5 December 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