@@ -3474,3 +3474,90 @@ const (
34743474 KLF_NOTELLSHELL = 0x00000080
34753475 KLF_SETFORPROCESS = 0x00000100
34763476)
3477+
3478+ // FocusEventRecord corresponds to the FocusEventRecord structure from the
3479+ // Windows console API.
3480+ // https://docs.microsoft.com/en-us/windows/console/focus-event-record-str
3481+ type FocusEventRecord struct {
3482+ // SetFocus is reserved and should not be used.
3483+ SetFocus bool
3484+ }
3485+
3486+ // KeyEventRecord corresponds to the KeyEventRecord structure from the Windows
3487+ // console API.
3488+ // https://docs.microsoft.com/en-us/windows/console/key-event-record-str
3489+ type KeyEventRecord struct {
3490+ // KeyDown specified whether the key is pressed or released.
3491+ KeyDown bool
3492+
3493+ // RepeatCount indicates that a key is being held down. For example, when a
3494+ // key is held down, five events with RepeatCount equal to 1 may be
3495+ // generated, one event with RepeatCount equal to 5, or multiple events
3496+ // with RepeatCount greater than or equal to 1.
3497+ RepeatCount uint16
3498+
3499+ // VirtualKeyCode identifies the given key in a device-independent manner
3500+ // (see
3501+ // https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes).
3502+ VirtualKeyCode uint16
3503+
3504+ // VirtualScanCode represents the device-dependent value generated by the
3505+ // keyboard hardware.
3506+ VirtualScanCode uint16
3507+
3508+ // Char is the character that corresponds to the pressed key. Char can be
3509+ // zero for some keys.
3510+ Char rune
3511+
3512+ //ControlKeyState holds the state of the control keys.
3513+ ControlKeyState uint32
3514+ }
3515+
3516+ // MenuEventRecord corresponds to the MenuEventRecord structure from the
3517+ // Windows console API.
3518+ // https://docs.microsoft.com/en-us/windows/console/menu-event-record-str
3519+ type MenuEventRecord struct {
3520+ CommandID uint32
3521+ }
3522+
3523+ // MouseEventRecord corresponds to the MouseEventRecord structure from the
3524+ // Windows console API.
3525+ // https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str
3526+ type MouseEventRecord struct {
3527+ // MousePosition contains the location of the cursor, in terms of the
3528+ // console screen buffer's character-cell coordinates.
3529+ MousePositon Coord
3530+
3531+ // ButtonState holds the status of the mouse buttons.
3532+ ButtonState uint32
3533+
3534+ // ControlKeyState holds the state of the control keys.
3535+ ControlKeyState uint32
3536+
3537+ // EventFlags specify the type of mouse event.
3538+ EventFlags uint32
3539+ }
3540+
3541+ // WindowBufferSizeRecord corresponds to the WindowBufferSizeRecord structure
3542+ // from the Windows console API.
3543+ // https://docs.microsoft.com/en-us/windows/console/window-buffer-size-record-str
3544+ type WindowBufferSizeRecord struct {
3545+ // Size contains the size of the console screen buffer, in character cell
3546+ // columns and rows.
3547+ Size Coord
3548+ }
3549+
3550+ // InputRecord corresponds to the INPUT_RECORD structure from the Windows
3551+ // console API.
3552+ //
3553+ // https://docs.microsoft.com/en-us/windows/console/input-record-str
3554+ type InputRecord struct {
3555+ // EventType specifies the type of event that helt in Event.
3556+ EventType uint16
3557+
3558+ // Padding of the 16-bit EventType to a whole 32-bit dword.
3559+ _ [2 ]byte
3560+
3561+ // Event holds the actual event data.
3562+ Event [16 ]byte
3563+ }
0 commit comments