en:docs:fapi:kbdgetstatus

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:docs:fapi:kbdgetstatus [2020/12/05 10:47] prokusheven:docs:fapi:kbdgetstatus [2021/09/18 15:29] prokushev
Line 1: Line 1:
-{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}+{{page>en:templates:fapiint}}
  
 ====== KbdGetStatus ====== ====== KbdGetStatus ======
Line 5: Line 5:
 This call gets the current state of the keyboard. This call gets the current state of the keyboard.
  
-==Syntax== +===== Syntax ===== 
- KbdGetStatus (StatData, KbdHandle)+<code c> 
 +KbdGetStatus (StatData, KbdHandle) 
 +</code>
  
-===Parameters=== +===== Parameters ===== 
-;StatData (PKBDINFO) - output : Address of the keyboard status structure: + 
-:length (USHORT) : Length, in bytes, of this data structure, including length. +  StatData (PKBDINFO) - output : Address of the keyboard status structure: 
- 10            Only valid value.  +    length (USHORT) : Length, in bytes, of this data structure, including length. 
-:sysstate (USHORT) : State as follows: +      10            Only valid value.  
- '''Bit                Description''' +    sysstate (USHORT) : State as follows: 
- 15-9                Reserved, set to zero.  +Bit Description ^ 
-                Shift return is on.  +15-9 Reserved, set to zero. | 
-                Length of the turn-around character (meaningful only if bit 6 is on).  +Shift return is on. | 
-                Turn-around character is modified.  +Length of the turn-around character (meaningful only if bit 6 is on). | 
-                Interim character flags are modified.  +Turn-around character is modified. | 
-                Shift state is modified.  +Interim character flags are modified. | 
-                ASCII mode is on.  +Shift state is modified. | 
-                Binary mode is on.  +ASCII mode is on. | 
-                Echo off.  +Binary mode is on. | 
-                Echo on.  +Echo off. | 
-:turnchardef (USHORT) : Definition of the turn-around character. In ASCII and extended-ASCII format, the turn-around character is defined as the carriage return. In ASCII format only, the turn-around character is defined in the low-order byte.  +Echo on. | 
-:intcharflag (USHORT) : Interim character flags: +    turnchardef (USHORT) : Definition of the turn-around character. In ASCII and extended-ASCII format, the turn-around character is defined as the carriage return. In ASCII format only, the turn-around character is defined in the low-order byte.  
- Bit     Description +    intcharflag (USHORT) : Interim character flags: 
- 15-8    NLS shift state.  +Bit Description ^ 
-       Interim character flag is on.  +15-8 NLS shift state. | 
-       Reserved, set to zero.  +Interim character flag is on. | 
-       Application requested immediate conversion.  +Reserved, set to zero. | 
- 4-0     Reserved, set to zero.  +Application requested immediate conversion. | 
-:shiftstate (USHORT) : Shift state as follows: +4-0 Reserved, set to zero. | 
- '''Bit                        Description''' +      shiftstate (USHORT) : Shift state as follows: 
- 15                        SysReq key down  +Bit Description ^ 
- 14                        CapsLock key down  +15 SysReq key down | 
- 13                        NumLock key down  +14 CapsLock key down | 
- 12                        ScrollLock key down  +13 NumLock key down | 
- 11                        Right Alt key down  +12 ScrollLock key down | 
- 10                        Right Ctrl key down  +11 Right Alt key down | 
-                        Left Alt key down  +10 Right Ctrl key down | 
-                        Left Ctrl key down  +Left Alt key down | 
-                        Insert on  +Left Ctrl key down | 
-                        CapsLock on  +Insert on | 
-                        NumLock on  +CapsLock on | 
-                        ScrollLock on  +NumLock on | 
-                        Either Alt key down  +ScrollLock on | 
-                        Either Ctrl key down  +Either Alt key down | 
-                        Left Shift key down  +Either Ctrl key down | 
-                        Right Shift key down. +Left Shift key down | 
-KbdHandle (HKBD) - input : Default keyboard or the logical keyboard.+Right Shift key down | 
 + 
 +  * KbdHandle (HKBD) - input : Default keyboard or the logical keyboard. 
 + 
 +===== Return Code ===== 
 + 
 +rc ([[USHORT]]) - return
  
-===Return Code=== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0    NO_ERROR  
-* 376        ERROR_KBD_INVALID_LENGTH  
-* 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==+  * 0    NO_ERROR  
 +  * 376        ERROR_KBD_INVALID_LENGTH  
 +  * 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 initial state of the keyboard is established by the system at application load time. Some default states may be modified by the application through KbdSetStatus. KbdGetStatus returns only those keyboard parameters initially set by KbdSetStatus. The returned parameters are: The initial state of the keyboard is established by the system at application load time. Some default states may be modified by the application through KbdSetStatus. KbdGetStatus returns only those keyboard parameters initially set by KbdSetStatus. The returned parameters are:
-* Input Mode  + 
-* Interim Character Flags  +  * Input Mode  
-* Shift State  +  * Interim Character Flags  
-* Echo State  +  * Shift State  
-* Turnaround Character +  * Echo State  
 +  * Turnaround Character  
 KbdGetStatus completes only when the handle has access to the physical keyboard (focus) or the handle is 0 and no other handle has the focus. KbdGetStatus completes only when the handle has access to the physical keyboard (focus) or the handle is 0 and no other handle has the focus.
  
-===Family API Considerations===+==== Family API Considerations ===
 Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restrictions apply to KbdGetStatus when coding in the DOS mode: Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following restrictions apply to KbdGetStatus when coding in the DOS mode:
-* Interim character is not supported  +  * Interim character is not supported  
-* TurnAround character is not supported  +  * TurnAround character is not supported  
-* NLS_SHIFT_STATE is always NULL. +  * NLS_SHIFT_STATE is always NULL. 
-* KbdHandle is ignored.+  * KbdHandle is ignored.
  
-==Example Code== +===== Bindings ===== 
-===C Binding=== + 
-<PRE>+==== C Binding ===
 + 
 +<code c>
 typedef struct _KBDINFO {     /* kbst */ typedef struct _KBDINFO {     /* kbst */
   USHORT cb;                  /* length in bytes of this structure */   USHORT cb;                  /* length in bytes of this structure */
Line 98: Line 111:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +==== MASM Binding ===
-<PRE>+ 
 +<code c>
 KBDINFO struc KBDINFO struc
   kbst_cb           dw  ? ;length in bytes of this structure   kbst_cb           dw  ? ;length in bytes of this structure
Line 118: Line 132:
  
 Returns WORD Returns WORD
-</PRE> +</code>
- +
- +
  
-====== Note ======+===== Note =====
  
 This text based on [[http://www.edm2.com/index.php/KbdGetStatus_(FAPI)]] This text based on [[http://www.edm2.com/index.php/KbdGetStatus_(FAPI)]]