Jump to content

KbdSetCp: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Description==
This function supports the code page switching for the keyboard. It sets to an installed code page, which is loaded if necessary.
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.  
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==
==Syntax==
<PRE>
KbdSetCp(ulReserved, pidCP, hkbd)
#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==
==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:
 
* 0 NO_ERROR
KbdSetCp returns one of the following values:
* 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
* 504 ERROR_KBD_EXTENDED_SG
* 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]]
[[Category:Kbd]]

Latest revision as of 20:20, 29 November 2019

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

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