consoleinput

package
v0.0.0-...-31a2298 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2018 License: BSD-3-Clause Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const ENABLE_MOUSE_INPUT = 16
View Source
const ENABLE_WINDOW_INPUT = 8
View Source
const FOCUS_EVENT = 16
View Source
const KEY_EVENT = 1
View Source
const MENU_EVENT = 8
View Source
const MOUSE_EVENT = 2
View Source
const WAIT_ABANDONED = 128
View Source
const WAIT_FAILED = -1
View Source
const WAIT_OBJECT_0 = 0
View Source
const WAIT_TIMEOUT = 258
View Source
const WINDOW_BUFFER_SIZE_EVENT = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

type Handle syscall.Handle

func New

func New() (Handle, error)

func (Handle) Close

func (handle Handle) Close() error

func (Handle) FlushConsoleInputBuffer

func (handle Handle) FlushConsoleInputBuffer() error

func (Handle) GetConsoleMode

func (handle Handle) GetConsoleMode() uint32

func (Handle) GetNumberOfEvent

func (handle Handle) GetNumberOfEvent() (int, error)

func (Handle) Read

func (handle Handle) Read(events []InputRecord) uint32

func (Handle) SetConsoleMode

func (handle Handle) SetConsoleMode(flag uint32)

func (Handle) WaitForSingleObject

func (handle Handle) WaitForSingleObject(msec uintptr) (uintptr, error)

func (Handle) Write

func (handle Handle) Write(events []InputRecord) uint32

type InputRecord

type InputRecord struct {
	EventType uint16

	Info [8]uint16
	// contains filtered or unexported fields
}

func (*InputRecord) KeyEvent

func (e *InputRecord) KeyEvent() *KeyEventRecord

func (*InputRecord) MouseEvent

func (e *InputRecord) MouseEvent() *MouseEventRecord

func (*InputRecord) ResizeEvent

func (e *InputRecord) ResizeEvent() (int16, int16)

type KeyEventRecord

type KeyEventRecord struct {
	KeyDown         int32
	RepeartCount    uint16
	VirtualKeyCode  uint16
	VirtualScanCode uint16
	UnicodeChar     uint16
	ControlKeyState uint32
}

type MouseEventRecord

type MouseEventRecord struct {
	X          int16
	Y          int16
	Button     uint32
	ControlKey uint32
	Event      uint32
}

func (MouseEventRecord) String

func (m MouseEventRecord) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL