en:ibm:prcp:kbd:gethwid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:ibm:prcp:kbd:gethwid [2014/05/16 17:17] – created valeriusen:ibm:prcp:kbd:gethwid [2016/09/15 02:39] (current) valerius
Line 1: Line 1:
 ==== KbdGetHWId ==== ==== KbdGetHWId ====
  
-**Bindings**: +**Bindings**: [[gethwid#C bindings|C]][[gethwid#MASM bindings|MASM]]
- +
-**C**: +
-<code c> +
-typedef struct _KBDHWID { +
-  USHORT length;              /* length in bytes of this structure */ +
-  USHORT kbd_id;              /* attached keyboard's hardware ID +
-                                  (returned) */ +
-  USHORT reserved1;           /* reserved (set to zero) */ +
-  USHORT reserved2;           /* reserved (set to zero) */ +
-}KBDHWID; +
- +
-#define INCL_KBD +
- +
-USHORT  rc = KbdGetHWId(KeyboardIDKbdHandle); +
- +
-PKBDHWID         KeyboardID;    /* Keyboard ID structure (returned) */ +
-HKBD             KbdHandle;     /* Keyboard handle  */ +
- +
-USHORT           rc;            /* return code */ +
-</code> +
- +
-**MASM**: +
-<code asm> +
-KBDHWID struc +
-  length;             dw  ? ;length in bytes of this structure +
-  kbd_id;             dw  ? ;attached keyboard's hardware ID (returned) +
-  reserved1;          dw  ? ;reserved (set to zero) +
-  reserved2;          dw  ? ;reserved (set to zero) +
-KBDHWID ends +
- +
-EXTRN KbdGetHWId:FAR +
-INCL_KBD            EQU 1 +
- +
-PUSH@ OTHER  KeyboardID      ;Keyboard ID structure (returned) +
-PUSH  WORD   KbdHandle       ;Keyboard handle +
-CALL  KbdGetHWId +
- +
-Returns WORD +
-</code>+
  
 Returns the attached keyboard's hardware-generated Identification value.  Returns the attached keyboard's hardware-generated Identification value. 
Line 86: Line 47:
  
 This function is of particular usefulness for applications providing Custom Translate Tables and mapping keyboard layouts.  This function is of particular usefulness for applications providing Custom Translate Tables and mapping keyboard layouts. 
 +
 +=== C bindings ===
 +
 +<code c>
 +typedef struct _KBDHWID {
 +  USHORT length;              /* length in bytes of this structure */
 +  USHORT kbd_id;              /* attached keyboard's hardware ID
 +                                  (returned) */
 +  USHORT reserved1;           /* reserved (set to zero) */
 +  USHORT reserved2;           /* reserved (set to zero) */
 +}KBDHWID;
 +
 +#define INCL_KBD
 +
 +USHORT  rc = KbdGetHWId(KeyboardID, KbdHandle);
 +
 +PKBDHWID         KeyboardID;    /* Keyboard ID structure (returned) */
 +HKBD             KbdHandle;     /* Keyboard handle  */
 +
 +USHORT           rc;            /* return code */
 +</code>
 +
 +=== MASM ===
 +
 +<code asm>
 +KBDHWID struc
 +  length;             dw  ? ;length in bytes of this structure
 +  kbd_id;             dw  ? ;attached keyboard's hardware ID (returned)
 +  reserved1;          dw  ? ;reserved (set to zero)
 +  reserved2;          dw  ? ;reserved (set to zero)
 +KBDHWID ends
 +
 +EXTRN KbdGetHWId:FAR
 +INCL_KBD            EQU 1
 +
 +PUSH@ OTHER  KeyboardID      ;Keyboard ID structure (returned)
 +PUSH  WORD   KbdHandle       ;Keyboard handle
 +CALL  KbdGetHWId
 +
 +Returns WORD
 +</code>