en:ibm:prcp:kbd:peek

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
en:ibm:prcp:kbd:peek [2014/05/16 18:25] valeriusen:ibm:prcp:kbd:peek [2016/09/15 02:46] (current) valerius
Line 1: Line 1:
 ==== KbdPeek ==== ==== KbdPeek ====
  
-**Bindings**: +**Bindings**: [[peek#C bindings|C]][[peek#MASM bindings|MASM]]
- +
-**C**: +
-<code c> +
-typedef struct _KBDKEYINFO {   /* kbci */ +
-  UCHAR    chChar;             /* ASCII character code */ +
-  UCHAR    chScan;             /* Scan Code */ +
-  UCHAR    fbStatus;           /* State of the character */ +
-  UCHAR    bNlsShift;          /* Reserved (set to zero) */ +
-  USHORT   fsState;            /* State of the shift keys */ +
-  ULONG    time;               /* Time stamp of keystroke (ms since ipl) */ +
-}KBDKEYINFO; +
- +
-#define INCL_KBD +
- +
-USHORT  rc = KbdPeek(CharDataKbdHandle); +
- +
-PKBDKEYINFO      CharData;      /* Buffer for data */ +
-HKBD             KbdHandle;     /* Keyboard handle */ +
- +
-USHORT           rc;            /* return code */068068 +
-</code> +
- +
-**MASM**: +
-<code asm> +
-KBDKEYINFO struc +
-  kbci_chChar    db  ? ;ASCII character code +
-  kbci_chScan    db  ? ;Scan Code +
-  kbci_fbStatus  db  ? ;State of the character +
-  kbci_bNlsShift db  ? ;Reserved (set to zero) +
-  kbci_fsState   dw  ? ;state of the shift keys +
-  kbci_time      dd  ? ;time stamp of keystroke (ms since ipl) +
-KBDKEYINFO ends +
- +
-EXTRN  KbdPeek:FAR +
-INCL_KBD            EQU 1 +
- +
-PUSH@  OTHER   CharData      ;Buffer for data +
-PUSH   WORD    KbdHandle     ;Keyboard handle +
-CALL   KbdPeek +
- +
-Returns WORD +
-</code>+
  
 This call returns any available character data record from the keyboard without removing it from the buffer.  This call returns any available character data record from the keyboard without removing it from the buffer. 
Line 132: Line 90:
   * //Status// can be 0 or 1.    * //Status// can be 0 or 1. 
   * //KbdHandle// is ignored.    * //KbdHandle// is ignored. 
 +
 +=== C bindings ===
 +
 +<code c>
 +typedef struct _KBDKEYINFO {   /* kbci */
 +  UCHAR    chChar;             /* ASCII character code */
 +  UCHAR    chScan;             /* Scan Code */
 +  UCHAR    fbStatus;           /* State of the character */
 +  UCHAR    bNlsShift;          /* Reserved (set to zero) */
 +  USHORT   fsState;            /* State of the shift keys */
 +  ULONG    time;               /* Time stamp of keystroke (ms since ipl) */
 +}KBDKEYINFO;
 +
 +#define INCL_KBD
 +
 +USHORT  rc = KbdPeek(CharData, KbdHandle);
 +
 +PKBDKEYINFO      CharData;      /* Buffer for data */
 +HKBD             KbdHandle;     /* Keyboard handle */
 +
 +USHORT           rc;            /* return code */068068
 +</code>
 +
 +=== MASM bindings ===
 +
 +<code asm>
 +KBDKEYINFO struc
 +  kbci_chChar    db  ? ;ASCII character code
 +  kbci_chScan    db  ? ;Scan Code
 +  kbci_fbStatus  db  ? ;State of the character
 +  kbci_bNlsShift db  ? ;Reserved (set to zero)
 +  kbci_fsState   dw  ? ;state of the shift keys
 +  kbci_time      dd  ? ;time stamp of keystroke (ms since ipl)
 +KBDKEYINFO ends
 +
 +EXTRN  KbdPeek:FAR
 +INCL_KBD            EQU 1
 +
 +PUSH@  OTHER   CharData      ;Buffer for data
 +PUSH   WORD    KbdHandle     ;Keyboard handle
 +CALL   KbdPeek
 +
 +Returns WORD
 +</code>