@@ -3,26 +3,24 @@ package windows
3
3
// InputRecord is the data structure that ReadConsoleInput writes into.
4
4
// See: https://docs.microsoft.com/en-us/windows/console/input-record-str
5
5
type InputRecord struct {
6
- // Type can be one of the following:
7
- // 0x1: The event is of type KEY_EVENT: https://docs.microsoft.com/en-us/windows/console/key-event-record-str
8
- // 0x2: The event is of type MOUSE_EVENT and will never be read when using ReadConsoleInput
9
- // 0x4: The event is of type WINDOW_BUFFER_SIZE_EVENT: https://docs.microsoft.com/en-us/windows/console/window- buffer- size-record-str
10
- // 0x8: The event is of type MENU_EVENT and should be ignored.
11
- // 0x10: The event is of type FOCUS_EVENT and should be ignored.
6
+ // Original source: https://docs.microsoft.com/en-us/windows/console/input-record-str#members
7
+ // 0x1: Key event
8
+ // 0x2: Will never be read when using ReadConsoleInput
9
+ // 0x4: Window buffer size event
10
+ // 0x8: Deprecated
11
+ // 0x10: Deprecated
12
12
Type uint16
13
13
_ [2 ]byte // discard the next two bytes
14
14
15
15
// Event contents can be one of:
16
16
// KEY_EVENT (Type == 1)
17
17
// - Event[0] is 0x1 if the key is pressed, 0x0 if the key is released
18
- // - Event[1] and Event[2] is random garbage
19
- // - Event[3] is the keycode of the pressed key. The numbers are completely different
20
- // to normal ASCII keycode, see
18
+ // - Event[3] is the keycode of the pressed key, see
21
19
// https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
22
- // - Event[4 ] is the keyboard scan code .
23
- // - Event[5] contains the typed ascii or Unicode (not UTF8!!) keycode .
24
- // from 0x20 through 0x7f they are equal
25
- // - Event[6] stores the state of the modifier keys. See https://docs.microsoft.com/en-us/windows/console/key-event-record-str
20
+ // - Event[5 ] is the ascii or Unicode keycode .
21
+ // - Event[6] stores the state of the modifier keys .
22
+ // See https://docs.microsoft.com/en-us/windows/console/key-event-record-str
23
+ //
26
24
// WINDOW_BUFFER_SIZE_EVENT (TYPE == 4)
27
25
// - Event[0] is the new amount of character rows
28
26
// - Event[1] is the new amount of character columns
0 commit comments