typedef struct _INPUT_RECORD { /* ir */
WORD EventType;
union {
KEY_EVENT_RECORD KeyEvent;
MOUSE_EVENT_RECORD MouseEvent;
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
MENU_EVENT_RECORD MenuEvent;
FOCUS_EVENT_RECORD FocusEvent;
} Event;
} INPUT_RECORD;
The INPUT_RECORD structure is used to report input events in the console input buffer. These records can be read from the input buffer using ReadConsoleInput or PeekConsoleInput, or written to the input buffer using WriteConsoleInput.
EventType
Identifies the type of input event and indicates which type of event record is stored in the Event member. This member can have one of the following values:
Value | Event Record Type |
KEY_EVENT | The Event member contains a KEY_EVENT_RECORD with information about a keyboard input event. |
The KEY_EVENT_RECORD structure has the following format: | |
typedef struct _KEY_EVENT_RECORD { /* ker */ BOOL bKeyDown; WORD wRepeatCount; WORD wVirtualKeyCode; WORD wVirtualScanCode; union { WCHAR UnicodeChar; CHAR AsciiChar; } uChar; DWORD dwControlKeyState; } KEY_EVENT_RECORD *PKEY_EVENT_RECORD; |
|
MOUSE_EVENT | The Event member contains a MOUSE_EVENT_RECORD with information about a mouse movement or button press event. |
The MOUSE_EVENT_RECORD structure has the following format: | |
typedef struct _MOUSE_EVENT_RECORD { /* mer */ COORD dwMousePosition; DWORD dwButtonState; DWORD dwControlKeyState; DWORD dwEventFlags; } MOUSE_EVENT_RECORD *PMOUSE_EVENT_RECORD; |
|
WINDOW_BUFFER_SIZE_EVENT | The Event member contains a WINDOW_BUFFER_SIZE_RECORD with information a user action to change the console window size. |
The WINDOW_BUFFER_SIZE_RECORD structure has the following format: | |
typedef struct _WINDOW_BUFFER_SIZE_RECORD { /* wbsr */ COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD *PWINDOW_BUFFER_SIZE_RECORD; |
|
MENU_EVENT | The Event member contains a MENU_EVENT_RECORD. These events are used internally, and should be ignored. |
The MENU_EVENT_RECORD structure has the following format: | |
typedef struct _MENU_EVENT_RECORD { /* mer */ UINT dwCommandId; } MENU_EVENT_RECORD *PMENU_EVENT_RECORD; |
|
FOCUS_EVENT | The Event member contains a FOCUS_EVENT_RECORD. These events are used internally, and should be ignored. |
The FOCUS_EVENT_RECORD structure has the following format: | |
typedef struct _FOCUS_EVENT_RECORD { /* fer */ BOOL bSetFocus; } FOCUS_EVENT_RECORD *PFOCUS_EVENT_RECORD; |
Event
Contains an Event Record with information about the input event. The type of Event Record is indicated by the EventType member.