event

package
v0.0.0-...-22b451c Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirstEvent = 0x0000
	UserEvent  = 0x8000
	LastEvent  = 0xFFFF
)
View Source
const (
	Quit = 0x100 + iota
	AppTerminating
	AppLowMemory
	AppWillEnterBackground
	AppDidEnterBackground
	AppWillEnterForeground
	AppDidEnterForeground
)

Application Events

View Source
const (
	JoyAxisMotion = 0x600 + iota
	JoyBallMotion
	JoyHatMotion
	JoyButtonDown
	JoyButtonUp
	JoyDeviceAdded
	JoyDeviceRemoved
)

Joystick Events

View Source
const (
	ControllerAxisMotion = 0x650 + iota
	ControllerButtonDown
	ControllerButtonUp
	ControllerDeviceAdded
	ControllerDeviceRemoved
	ControllerDeviceRemapped
)

Game Controller Events

View Source
const (
	FingerDown = 0x700 + iota
	FingerUp
	FingerMotion
)

Touch Events

View Source
const (
	DollarGesture = 0x800 + iota
	DollarRecord
	MultiGesture
)

Gesture Events

View Source
const (
	DropFile = 0x1000 + iota
	DropText
	DropBegin
	DropComplete
)

Drag and Drop Events

View Source
const (
	AudioDeviceAdded = 0x1100 + iota
	AudioDeviceRemoved
)

Audio Hotplug Events

View Source
const (
	RenderTargetsReset = 0x2000 + iota
	RenderDeviceReset
)

Render Events

View Source
const (
	KeyDown = 0x300 + iota
	KeyUp
	TextEditing
	TextInput
	KeyMapChanged
)

Keyboard Events

View Source
const (
	MouseMotion = 0x400 + iota
	MouseButtonDown
	MouseButtonUp
	MouseWheel
)

Mouse Events

View Source
const (
	Add = iota
	Peek
	Get
)
View Source
const (
	WindowStateChange = 0x200 + iota
	SysWMEvent
)

Window Events

View Source
const (
	WindowNone = iota
	WindowShown
	WindowHidden
	WindowExposed
	WindowMoved
	WindowResized
	WindowSizeChanged
	WindowMinimized
	WindowMaximized
	WindowRestored
	WindowEnter
	WindowLeave
	WindowFocusGained
	WindowFocusLost
	WindowClose
	WindowTakeFocus
	WindowHitTest
)
View Source
const (
	ClipboardUpdate = 0x900 + iota
)

Clipboard Events

View Source
const KeyPressed = 1
View Source
const KeyReleased = 0
View Source
const MaxQueued = 65535

Variables

View Source
var WaitTimeoutExceeded error = eventFilteredError{}

Functions

This section is empty.

Types

type Data

type Data [56]byte

Data is the raw event data,

func NewWindowEvent

func NewWindowEvent(id uint32, windowevent uint8, data1, data2 int) Data

func (Data) Raw

func (ed Data) Raw() *Data

func (Data) Timestamp

func (ed Data) Timestamp() uint32

func (Data) Type

func (ed Data) Type() uint32

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

type Event

type Event interface {
	Type() uint32
	Timestamp() uint32
	Raw() *Data
}

type Filter

type Filter func(userdata interface{}, event Event) bool

type KeyboardEvent

type KeyboardEvent Data

Keyboard button event structure (event.key.*)

func (KeyboardEvent) KeyCode

func (ke KeyboardEvent) KeyCode() int32

func (KeyboardEvent) Mod

func (ke KeyboardEvent) Mod() uint16

func (KeyboardEvent) Repeat

func (ke KeyboardEvent) Repeat() uint8

func (KeyboardEvent) ScanCode

func (ke KeyboardEvent) ScanCode() uint32

func (KeyboardEvent) State

func (ke KeyboardEvent) State() uint8

func (KeyboardEvent) WindowID

func (ke KeyboardEvent) WindowID() uint32

type Mouse

type Mouse struct {
}
var M *Mouse

func (*Mouse) FreeCursor

func (m *Mouse) FreeCursor()

type MouseButton

type MouseButton Data

Keyboard button event structure (event.key.*)

func (MouseButton) Button

func (mbe MouseButton) Button() uint8

func (MouseButton) Clicks

func (mbe MouseButton) Clicks() uint8

func (MouseButton) State

func (mbe MouseButton) State() uint8

func (MouseButton) Which

func (mbe MouseButton) Which() uint32

func (MouseButton) WindowID

func (mbe MouseButton) WindowID() uint32

func (MouseButton) X

func (mbe MouseButton) X() int32

func (MouseButton) Y

func (mbe MouseButton) Y() int32

type Pumper

type Pumper interface {
	Pump(q *Queue)
}

type Queue

type Queue struct {
	// contains filtered or unexported fields
}
var Q *Queue

func (*Queue) Add

func (q *Queue) Add(ev Event) error

func (*Queue) AddWatch

func (q *Queue) AddWatch(watcher *Watcher)

func (*Queue) Cut

func (q *Queue) Cut(entry *Entry)

func (*Queue) DelWatch

func (q *Queue) DelWatch(watcher *Watcher)

func (*Queue) Disable

func (q *Queue) Disable(eventType uint32)

func (*Queue) Enable

func (q *Queue) Enable(eventType uint32)

func (*Queue) Enabled

func (q *Queue) Enabled(eventType uint32) bool

func (*Queue) Filter

func (q *Queue) Filter(f Filter, userdata interface{}) error

func (*Queue) FlushType

func (q *Queue) FlushType(evType uint32) error

func (*Queue) FlushTypes

func (q *Queue) FlushTypes(minType, maxType uint32) error

func (*Queue) GetFilterr

func (q *Queue) GetFilterr() (Filter, interface{})

func (*Queue) HasType

func (q *Queue) HasType(evType uint32) (bool, error)

func (*Queue) HasTypes

func (q *Queue) HasTypes(minType, maxType uint32) (bool, error)

func (*Queue) Peep

func (q *Queue) Peep(events []Event, action int, minType, maxType uint32) (int, error)

Note: removed numevents to just use the slice length

func (*Queue) Poll

func (q *Queue) Poll() (Event, error)

func (*Queue) Pump

func (q *Queue) Pump()

func (*Queue) Push

func (q *Queue) Push(ev Event) (bool, error)

func (*Queue) SetFilter

func (q *Queue) SetFilter(f Filter, userdata interface{}) error

func (*Queue) Start

func (q *Queue) Start() error

func (*Queue) Stop

func (q *Queue) Stop()

func (*Queue) Wait

func (q *Queue) Wait() (Event, error)

func (*Queue) WaitTimeout

func (q *Queue) WaitTimeout(timeout time.Duration) (Event, error)

type Watcher

type Watcher struct {
	Callback Filter
	Userdata interface{}
}

type Window

type Window Data

Window state change event data (event.window.*)

func (Window) Data1

func (we Window) Data1() int32

func (Window) Data2

func (we Window) Data2() int32

func (Window) Event

func (we Window) Event() uint8

func (Window) WindowID

func (we Window) WindowID() uint32

Jump to

Keyboard shortcuts

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