Jump to content

KBDKEYINFO: Difference between revisions

From EDM2
Anakor (talk | contribs)
New
 
Ak120 (talk | contribs)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== KBDKEYINFO ==
Character data structure.
Character data structure.


=== Type ===  
=== Type ===  
 
  [[UCHAR]]  chChar
  [[OS2 API:DataType:UCHAR|UCHAR]]  chChar
  UCHAR  chScan
  [[OS2 API:DataType:UCHAR|UCHAR]]   chScan
  UCHAR  fbStatus
  [[OS2 API:DataType:UCHAR|UCHAR]]   fbStatus
  UCHAR  bNlsShift
  [[OS2 API:DataType:UCHAR|UCHAR]]   bNlsShift
  [[USHORT]]  fsState
  [[OS2 API:DataType:USHORT|USHORT]]  fsState
  ULONG  time
  [[OS2 API:DataType:USHORT|USHORT]]  time


==== C Declaration Method ====
==== C Declaration Method ====
typedef struct
typedef struct


=== Fields ===
=== Fields ===
 
;chChar:ASCII Character code.
chChar   ASCII Character code.
:The scan code received from the keyboard is translated to the ASCII character code.
          The scan code received from the keyboard is translated to the ASCII
;chScan:Code received for the keyboard.
          character code.
:Scan code received from the keyboard is translated to the ASCII character code.
 
;fbStatus:State of the keystroke event flag.
chScan   Code received for the keyboard.
::Bits 7-6  Has the following values:
          Scan code received from the keyboard is translated to the ASCII
:::00  Undefined.  
          character code.
:::01  Final character; interim character flag is turned off.
 
:::10  Interim character.  
fbStatus State of the keystroke event flag.
:::11  Final character; interim character flag is turned on.
          Bits 7-6  Has the following values:
::Bit 5 - If set to 1, immediate conversion requested.
                00  Undefined.  
::Bits 4-2 - Reserved.  
                01  Final character; interim character flag is turned off.
::Bit 1 - Has the following values:
                10  Interim character.  
:::0  Scan code is a character  
                11  Final character; interim character flag is turned on.
:::1  Scan code is not a character; instead it is an extended key code from the keyboard.
          Bit 5     If set to 1, immediate conversion requested.
::Bit 0 - If set to 1, shift status returned without a character.
          Bits 4-2 Reserved.  
;bNlsShift:NLS shift status. Reserved, must be 0.
          Bit 1   Has the following values:
::7
                  0  Scan code is a character  
:::Kana-To-Kanji Conversion Mode (Japanese)
                  1  Scan code is not a character; instead it is an extended key
:::Hanja_25: Hangeul-to-Hanja Conversion Mode (Korean)
                    code from the keyboard.
:::Reserved (T-Chinese)
          Bit 0     If set to 1, shift status returned without a character.
::6
 
:::Romaji Mode (Japanese)
bNlsShift NLS shift status. Reserved, must be 0.
:::Hanja_CSR: Hangeul-to-Hanja Conversion Mode (Korean)
 
:::Reserved (T-Chinese)
fsState   Shift key status flag.
::5
          Values are:
:::Reserved
          Bit 15   SysReq key down  
::4-3
          Bit 14   Caps Lock key down  
:::00 Shift Indicator Row always visible
          Bit 13   NumLock key down  
:::01 Shift Indicator Row always invisible
          Bit 12   Scroll Lock key down  
:::10 Shift Indicator Row visible only when a shift key is pressed. And it becomes invisible, depress another key.
          Bit 11   Right Alt key down  
:::11 Reserved
          Bit 10   Right Ctrl key down  
::2-1
          Bit  9   Left Alt key down  
:::00 Alphanumeric Mode
          Bit  8   Left Ctrl key down  
:::01 Katakana Mode (Japanese)<br/>Jamo Mode (Korean)<br/>Phonetic Input Mode (T-Chinese)
          Bit  7   Insert on  
:::10 Hiragana Mode (Japanese)<br/>Hangeul Mode (Korean)<br/>TsangJye Input Mode (T-Chinese)
          Bit  6   Caps Lock on  
:::11 Reserved
          Bit  5   NumLock on.
::0
          Bit  4   Scroll Lock on  
:::DBCS Mode
          Bit  3   Either Alt key down  
;fsState:Shift key status flag.
          Bit  2   Either Ctrl key down  
::{|class="wikitable"
          Bit  1   Left Shift key down  
|+Shift key status
          Bit  0   Right Shift key down
!Bit||Description
|-
|15||SysReq key down
|-
|14||CapsLock key down
|-
|13||NumLock key down
|-
|12||ScrollLock key down
|-
|11||Right Alt key down (SBCS)
|-
|10||Right Ctrl key down (SBCS)
|-
|9||Left Alt key down
|-
|8||Left Ctrl key down
|-
|7||Insert on
|-
|6||CapsLock on
|-
|5||NumLock on
|-
|4||ScrollLock on
|-
|3||Either Alt key down (DBCS)
|-
|2||Either Ctrl key down (DBCS)
|-
|1||Left Shift key down
|-
|0||Right Shift key down
|}
;time:Time stamp in milliseconds.
:Time stamp indicating when a key was pressed. It is specified in milliseconds from the time the system was started.


time      Time stamp in milliseconds.
[[Category:Data type]]
          Time stamp indicating when a key was pressed. It is specified in
          milliseconds from the time the system was started.

Latest revision as of 03:32, 24 January 2023

Character data structure.

Type

UCHAR   chChar
UCHAR   chScan
UCHAR   fbStatus
UCHAR   bNlsShift
USHORT  fsState
ULONG   time

C Declaration Method

typedef struct

Fields

chChar
ASCII Character code.
The scan code received from the keyboard is translated to the ASCII character code.
chScan
Code received for the keyboard.
Scan code received from the keyboard is translated to the ASCII character code.
fbStatus
State of the keystroke event flag.
Bits 7-6 Has the following values:
00 Undefined.
01 Final character; interim character flag is turned off.
10 Interim character.
11 Final character; interim character flag is turned on.
Bit 5 - If set to 1, immediate conversion requested.
Bits 4-2 - Reserved.
Bit 1 - Has the following values:
0 Scan code is a character
1 Scan code is not a character; instead it is an extended key code from the keyboard.
Bit 0 - If set to 1, shift status returned without a character.
bNlsShift
NLS shift status. Reserved, must be 0.
7
Kana-To-Kanji Conversion Mode (Japanese)
Hanja_25: Hangeul-to-Hanja Conversion Mode (Korean)
Reserved (T-Chinese)
6
Romaji Mode (Japanese)
Hanja_CSR: Hangeul-to-Hanja Conversion Mode (Korean)
Reserved (T-Chinese)
5
Reserved
4-3
00 Shift Indicator Row always visible
01 Shift Indicator Row always invisible
10 Shift Indicator Row visible only when a shift key is pressed. And it becomes invisible, depress another key.
11 Reserved
2-1
00 Alphanumeric Mode
01 Katakana Mode (Japanese)
Jamo Mode (Korean)
Phonetic Input Mode (T-Chinese)
10 Hiragana Mode (Japanese)
Hangeul Mode (Korean)
TsangJye Input Mode (T-Chinese)
11 Reserved
0
DBCS Mode
fsState
Shift key status flag.
Shift key status
Bit Description
15 SysReq key down
14 CapsLock key down
13 NumLock key down
12 ScrollLock key down
11 Right Alt key down (SBCS)
10 Right Ctrl key down (SBCS)
9 Left Alt key down
8 Left Ctrl key down
7 Insert on
6 CapsLock on
5 NumLock on
4 ScrollLock on
3 Either Alt key down (DBCS)
2 Either Ctrl key down (DBCS)
1 Left Shift key down
0 Right Shift key down
time
Time stamp in milliseconds.
Time stamp indicating when a key was pressed. It is specified in milliseconds from the time the system was started.