ewindows

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package ewindows provides extra Windows-specific system utilities.

Index

Constants

View Source
const (
	WAIT_OBJECT_0    = 0
	WAIT_ABANDONED_0 = 0x00000080
	WAIT_TIMEOUT     = 0x00000102
	WAIT_FAILED      = 0xFFFFFFFF
)
View Source
const (
	KEY_EVENT                = 0x1
	MOUSE_EVENT              = 0x2
	WINDOW_BUFFER_SIZE_EVENT = 0x4
	MENU_EVENT               = 0x8
	FOCUS_EVENT              = 0x10
)
View Source
const (
	INFINITE = 0xFFFFFFFF
)

Variables

This section is empty.

Functions

func ReadConsoleInput

func ReadConsoleInput(h windows.Handle, buf []InputRecord) (int, error)

ReadConsoleInput input wraps the homonymous Windows API call.

func WaitForMultipleObjects

func WaitForMultipleObjects(handles []windows.Handle, waitAll bool,
	timeout uint32) (trigger int, abandoned bool, err error)

WaitForMultipleObjects blocks until any of the objects is triggered or timeout.

DWORD WINAPI WaitForMultipleObjects(

_In_       DWORD  nCount,
_In_ const HANDLE *lpHandles,
_In_       BOOL   bWaitAll,
_In_       DWORD  dwMilliseconds

);

Types

type Coord

type Coord struct {
	X int16
	Y int16
}

type FocusEvent

type FocusEvent struct {
	BSetFocus int32
}

type InputEvent

type InputEvent interface {
	// contains filtered or unexported methods
}

InputEvent is either a KeyEvent, MouseEvent, WindowBufferSizeEvent, MenuEvent or FocusEvent.

type InputRecord

type InputRecord struct {
	EventType uint16
	Pad_cgo_0 [2]byte
	Event     [16]byte
}

func (*InputRecord) GetEvent

func (input *InputRecord) GetEvent() InputEvent

GetEvent converts InputRecord to InputEvent.

type KeyEvent

type KeyEvent struct {
	BKeyDown          int32
	WRepeatCount      uint16
	WVirtualKeyCode   uint16
	WVirtualScanCode  uint16
	UChar             [2]byte
	DwControlKeyState uint32
}
type MenuEvent struct {
	DwCommandId uint32
}

type MouseEvent

type MouseEvent struct {
	DwMousePosition   Coord
	DwButtonState     uint32
	DwControlKeyState uint32
	DwEventFlags      uint32
}

type WindowBufferSizeEvent

type WindowBufferSizeEvent struct {
	DwSize Coord
}

Jump to

Keyboard shortcuts

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