Jump to content

KbdRegister: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call registers a keyboard subsystem within a session.
This call registers a keyboard subsystem within a session.


Line 9: Line 8:
;EntryPoint (PSZ) - input : Address of the dynamic link entry point name of a routine that receives control when any of the registered functions are called. Maximum length is 33 bytes (including ASCIIZ terminator).
;EntryPoint (PSZ) - input : Address of the dynamic link entry point name of a routine that receives control when any of the registered functions are called. Maximum length is 33 bytes (including ASCIIZ terminator).
;FunctionMask (ULONG) - input : A bit mask where each bit identifies a keyboard function being registered. The bit values are:
;FunctionMask (ULONG) - input : A bit mask where each bit identifies a keyboard function being registered. The bit values are:
  '''Bit         Description'''
  Bit   Description
  31-15       Reserved, must be set to zero.
  31-15 Reserved, must be set to zero.
  14       KbdGetHWId
  14   KbdGetHWId
  13       KbdSetCustXt
  13   KbdSetCustXt
  12       KbdXlate
  12   KbdXlate
  11       KbdSetCp
  11   KbdSetCp
  10       KbdGetCp
  10   KbdGetCp
  9       KbdFreeFocus
  9     KbdFreeFocus
  8       KbdGetFocus
  8     KbdGetFocus
  7       KbdClose
  7     KbdClose
  6       KbdOpen
  6     KbdOpen  
  5       KbdStringIn
  5     KbdStringIn
  4       KbdSetStatus
  4     KbdSetStatus
  3       KbdGetStatus
  3     KbdGetStatus
  2       KbdFlushBuffer
  2     KbdFlushBuffer
  1       KbdPeek
  1     KbdPeek
  0       KbdCharIn
  0     KbdCharIn


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
Return code descriptions are:
* 0  NO_ERROR
* 0  NO_ERROR
* 408 ERROR_KBD_INVALID_ASCIIZ  
* 408 ERROR_KBD_INVALID_ASCIIZ  
* 409 ERROR_KBD_INVALID_MASK  
* 409 ERROR_KBD_INVALID_MASK
* 410 ERROR_KBD_REGISTER  
* 410 ERROR_KBD_REGISTER
* 464 ERROR_KBD_DETACHED  
* 464 ERROR_KBD_DETACHED
* 504 ERROR_KBD_EXTENDED_SG
* 504 ERROR_KBD_EXTENDED_SG


==Remarks==
==Remarks==
There can be only one KbdRegister call outstanding for each session without an intervening KbdDeRegister. KbdDeRegister must be issued by the same process that issued the KbdRegister.
There can be only one KbdRegister call outstanding for each session without an intervening [[KbdDeRegister]]. KbdDeRegister must be issued by the same process that issued the KbdRegister.


==Example Code==
==Bindings==
=== C Binding===
===C===
<PRE>
<PRE>
#define INCL_KBD
#define INCL_KBD
Line 48: Line 45:
USHORT  rc = KbdRegister(ModuleName, EntryPoint, FunctionMask);
USHORT  rc = KbdRegister(ModuleName, EntryPoint, FunctionMask);


PSZ             ModuleName;    /* Module name */
PSZ     ModuleName;    /* Module name */
PSZ             EntryPoint;    /* Entry point name */
PSZ     EntryPoint;    /* Entry point name */
ULONG           FunctionMask;  /* Function mask */
ULONG   FunctionMask;  /* Function mask */


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


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  KbdRegister:FAR
EXTRN  KbdRegister:FAR

Latest revision as of 16:04, 3 January 2019

This call registers a keyboard subsystem within a session.

Syntax

KbdRegister (ModuleName, EntryPoint, FunctionMask)

Parameters

ModuleName (PSZ) - input
Address of the dynamic link module name. Maximum length is 9 bytes (including ASCIIZ terminator).
EntryPoint (PSZ) - input
Address of the dynamic link entry point name of a routine that receives control when any of the registered functions are called. Maximum length is 33 bytes (including ASCIIZ terminator).
FunctionMask (ULONG) - input
A bit mask where each bit identifies a keyboard function being registered. The bit values are:
Bit   Description
31-15 Reserved, must be set to zero.
14    KbdGetHWId
13    KbdSetCustXt
12    KbdXlate
11    KbdSetCp
10    KbdGetCp
9     KbdFreeFocus
8     KbdGetFocus
7     KbdClose
6     KbdOpen 
5     KbdStringIn
4     KbdSetStatus
3     KbdGetStatus
2     KbdFlushBuffer
1     KbdPeek
0     KbdCharIn

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 408 ERROR_KBD_INVALID_ASCIIZ
  • 409 ERROR_KBD_INVALID_MASK
  • 410 ERROR_KBD_REGISTER
  • 464 ERROR_KBD_DETACHED
  • 504 ERROR_KBD_EXTENDED_SG

Remarks

There can be only one KbdRegister call outstanding for each session without an intervening KbdDeRegister. KbdDeRegister must be issued by the same process that issued the KbdRegister.

Bindings

C

#define INCL_KBD

USHORT  rc = KbdRegister(ModuleName, EntryPoint, FunctionMask);

PSZ     ModuleName;    /* Module name */
PSZ     EntryPoint;    /* Entry point name */
ULONG   FunctionMask;  /* Function mask */

USHORT  rc;            /* return code */

MASM

EXTRN  KbdRegister:FAR
INCL_KBD            EQU 1

PUSH@  ASCIIZ  ModuleName    ;Module name
PUSH@  ASCIIZ  EntryPoint    ;Entry point name
PUSH   DWORD   FunctionMask  ;Function mask
CALL   KbdRegister

Returns WORD