Jump to content

KbdGetCp (FAPI): Difference between revisions

From EDM2
Created page with "==Description== This call allows a process to query the code page being used to translate scan codes to ASCII characters. ==Syntax== <PRE> KbdGetCp (Reserved, CodePageI..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Description==
This call allows a process to query the code page being used to translate scan codes to ASCII characters.
This call allows a process to query the code page being used to translate scan codes to ASCII characters.


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


    (Reserved, CodePageID, KbdHandle)
</PRE>
==Parameters==
==Parameters==
; Reserved (ULONG) - input : Reserved and must be set to zero.  
;Reserved (ULONG) - input: Reserved and must be set to zero.
 
;CodePageID (PUSHORT) - output: Address of the code page ID located in the application's data area. The keyboard support copies the current code page ID for a specified keyboard handle into this word. The code page ID is equivalent to one of the code page IDs specified in the CONFIG.SYS CODEPAGE = statement or 0000.
; CodePageID (PUSHORT) - output : Address of the code page ID located in the application's data area. The keyboard support copies the current code page ID for a specified keyboard handle into this word. The code page ID is equivalent to one of the code page IDs specified in the CONFIG.SYS CODEPAGE = statement or 0000.  
;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:
::373 ERROR_KBD_PARAMETER
 
::439 ERROR_KBD_INVALID_HANDLE
* 0         NO_ERROR  
::445 ERROR_KBD_FOCUS_REQUIRED
* 373       ERROR_KBD_PARAMETER  
::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 CodePageID is the currently active keyboard code page. A value of 0 indicates the code page translation table in use is the ROM code page translation table provided by the hardware.  
The CodePageID is the currently active keyboard code page. A value of 0 indicates the code page translation table in use is the ROM code page translation table provided by the hardware.


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_KBD
#define INCL_KBD
Line 38: Line 29:
USHORT  rc = KbdGetCp(Reserved, CodePageID, KbdHandle);
USHORT  rc = KbdGetCp(Reserved, CodePageID, KbdHandle);


ULONG           Reserved;     /* Reserved (must be zero) */
ULONG   Reserved;     /* Reserved (must be zero) */
PUSHORT         CodePageID;   /* Code Page ID */
PUSHORT 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  KbdGetCp:FAR
EXTRN  KbdGetCp:FAR
INCL_KBD           EQU 1
INCL_KBD   EQU 1


PUSH  DWORD  Reserved     ;Reserved (must be zero)
PUSH  DWORD  Reserved     ;Reserved (must be zero)
PUSH@  WORD    CodePageID   ;Code Page ID
PUSH@  WORD    CodePageID   ;Code Page ID
PUSH  WORD    KbdHandle     ;Keyboard handle
PUSH  WORD    KbdHandle   ;Keyboard handle
CALL  KbdGetCp
CALL  KbdGetCp


Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


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

Latest revision as of 12:53, 29 February 2020

This call allows a process to query the code page being used to translate scan codes to ASCII characters.

Syntax

KbdGetCp (Reserved, CodePageID, KbdHandle)

Parameters

Reserved (ULONG) - input
Reserved and must be set to zero.
CodePageID (PUSHORT) - output
Address of the code page ID located in the application's data area. The keyboard support copies the current code page ID for a specified keyboard handle into this word. The code page ID is equivalent to one of the code page IDs specified in the CONFIG.SYS CODEPAGE = statement or 0000.
KbdHandle (HKBD) - input
Default keyboard or the logical keyboard.

Return Code

rc (USHORT) - return
Return code descriptions are:
0 NO_ERROR
373 ERROR_KBD_PARAMETER
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 CodePageID is the currently active keyboard code page. A value of 0 indicates the code page translation table in use is the ROM code page translation table provided by the hardware.

Bindings

C

#define INCL_KBD

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

ULONG   Reserved;     /* Reserved (must be zero) */
PUSHORT CodePageID;   /* Code Page ID */
HKBD    KbdHandle;    /* Keyboard handle */

USHORT  rc;           /* return code */

MASM

EXTRN  KbdGetCp:FAR
INCL_KBD    EQU 1

PUSH   DWORD   Reserved     ;Reserved (must be zero)
PUSH@  WORD    CodePageID   ;Code Page ID
PUSH   WORD    KbdHandle    ;Keyboard handle
CALL   KbdGetCp

Returns WORD