en:docs:fapi:kbdsetstatus

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:fapi:kbdsetstatus [2021/08/20 08:00] – prokusheven:docs:fapi:kbdsetstatus [2021/09/19 01:27] (current) – prokushev
Line 5: Line 5:
 This call sets the characteristics of the keyboard. This call sets the characteristics of the keyboard.
  
-==Syntax==+===== Syntax ===== 
 +<code c>
  KbdSetStatus (StatData, KbdHandle)  KbdSetStatus (StatData, KbdHandle)
 +</code>
  
-==Parameters== +===== Parameters ===== 
-;StatData (PKBDINFO) - input : Address of the keyboard status structure: + 
-:length ([[USHORT]]) : Length, in bytes, of this data structure, including length. +  * StatData ([[PKBDINFO]]) - input : Address of the keyboard status structure: 
-::10 - Only valid value.  +    * length ([[USHORT]]) : Length, in bytes, of this data structure, including length. 
-:sysstate (USHORT) : The system state altered by this call. If bits 0 and 1 are off, the echo state of the system is not altered. If bits 2 and 3 are off, the binary and ASCII state of the system is not altered. If bits 0 and 1 are on, or if bits 2 and 3 are on, the function returns an error. If binary mode is set, echo is ignored. +      * 10 - Only valid value.  
- '''Bit     Description''' +    * sysstate ([[USHORT]]) : The system state altered by this call. If bits 0 and 1 are off, the echo state of the system is not altered. If bits 2 and 3 are off, the binary and ASCII state of the system is not altered. If bits 0 and 1 are on, or if bits 2 and 3 are on, the function returns an error. If binary mode is set, echo is ignored. 
- 15-9    Reserved, set to zero   + 
- 8       Shift return is on   +^ Bit ^ Description ^ 
- 7       Length of the turn-around character (meaningful only if bit 6 is on).   +| 15-9 | Reserved, set to zero | 
- 6       Turn-around character is modified   +| 8 | Shift return is on | 
- 5       Interim character flags are modified   +| 7 | Length of the turn-around character (meaningful only if bit 6 is on). | 
- 4       Shift state is modified   +| 6 | Turn-around character is modified | 
- 3       ASCII mode is on   +| 5 | Interim character flags are modified | 
- 2       Binary mode is on   +| 4 | Shift state is modified | 
- 1       Echo off   +| 3 | ASCII mode is on | 
- 0       Echo on  +| 2 | Binary mode is on | 
-: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. +| 1 | Echo off | 
-:intcharflag (USHORT) : Interim character flags: +| 0 | Echo on | 
- '''Bit     Description'''  + 
- 15-8    NLS shift state.  +    * 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. 
- 7       Interim character flag is on  +    * intcharflag ([[USHOR]]T) : Interim character flags: 
- 6       Reserved, set to zero  + 
- 5       Application requested immediate conversion  +^ Bit ^ Description ^ 
- 4-0     Reserved, set to zero +| 15-8 | NLS shift state. | 
-:shiftstate (USHORT) : Shift state. +| 7 | Interim character flag is on | 
- '''Bit      Description'''  +| 6 | Reserved, set to zero | 
- 15       SysReq key down  +| 5 | Application requested immediate conversion | 
- 14       CapsLock key down  +| 4-0 | Reserved, set to zero | 
- 13       NumLock key down  + 
- 12       ScrollLock key down  +    * shiftstate ([[USHORT]]) : Shift state. 
- 11       Right Alt key down  + 
- 10       Right Ctrl key down  +^ Bit ^ Description ^ 
- 9        Left Alt key down  +| 15 | SysReq key down | 
- 8        Left Ctrl key down  +| 14 | CapsLock key down | 
- 7        Insert on  +| 13 | NumLock key down | 
- 6        CapsLock on  +| 12 | ScrollLock key down | 
- 5        NumLock on  +| 11 | Right Alt key down | 
- 4        ScrollLock on  +| 10 | Right Ctrl key down | 
- 3        Either Alt key down  +| 9 | Left Alt key down | 
- 2        Either Ctrl key down  +| 8 | Left Ctrl key down | 
- 1        Left Shift key down  +| 7 | Insert on | 
- 0        Right Shift key down +| 6 | CapsLock on | 
-;KbdHandle ([[HKBD]]) - input : Default keyboard or the logical keyboard.+| 5 | NumLock on | 
 +| 4 | ScrollLock on | 
 +| 3 | Either Alt key down | 
 +| 2 | Either Ctrl key down | 
 +| 1 | Left Shift key down | 
 +| 0 | Right Shift key down | 
 + 
 +  * KbdHandle ([[HKBD]]) - input : Default keyboard or the logical keyboard. 
 + 
 +===== Return Code ===== 
 + 
 +rc ([[USHOR]]T) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0    NO_ERROR  
-* 376        ERROR_KBD_INVALID_LENGTH  
-* 377        ERROR_KBD_INVALID_ECHO_MASK  
-* 378        ERROR_KBD_INVALID_INPUT_MASK  
-* 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  
 +  * 377        ERROR_KBD_INVALID_ECHO_MASK  
 +  * 378        ERROR_KBD_INVALID_INPUT_MASK  
 +  * 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 ===== 
 Shift return (bit 8 in sysstate) must be disabled in ASCII mode. Shift return (bit 8 in sysstate) must be disabled in ASCII mode.
  
 KbdSetStatus is ignored for a Vio-windowed application. KbdSetStatus is ignored for a Vio-windowed application.
  
-===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 KbdSetStatus 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 KbdSetStatus when coding in the DOS mode:
-* KbdSetStatus does not accept a bit mask of 10 (ASCII on, Echo Off). +  * KbdSetStatus does not accept a bit mask of 10 (ASCII on, Echo Off). 
-* Raw (binary) Mode and Echo On are not supported and return an error if requested. +  * Raw (binary) Mode and Echo On are not supported and return an error if requested. 
-* KbdHandle is ignored. +  * KbdHandle is ignored. 
-* Interim character is not supported. +  * Interim character is not supported. 
-* Turnaround character is not supported.+  * Turnaround character is not supported. 
 + 
 +===== Bindings ===== 
 + 
 +==== C Binding ====
  
-==Example Code== +<code c>
-===C Binding=== +
-<PRE>+
 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 97: Line 113:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +==== MASM Binding ==== 
-<PRE>+ 
 +<code asm>
 KBDINFO struc KBDINFO struc
   kbst_cb           dw  ? ;length in bytes of this structure   kbst_cb           dw  ? ;length in bytes of this structure
Line 117: Line 134:
  
 Returns WORD Returns WORD
-</PRE> +</code>
- +
  
-====== Note ======+===== Note =====
  
 Text based on [[http://www.edm2.com/index.php/KbdSetStatus_(FAPI)]] Text based on [[http://www.edm2.com/index.php/KbdSetStatus_(FAPI)]]