event

package
v0.0.0-...-a673a00 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Contains = func(s []EventCategory, e EventCategory) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

Functions

This section is empty.

Types

type Event

type Event interface {
	GetEventType() EventType
	GetName() string
	GetCategoryFlags() []EventCategory
	String() string
	IsInCategory(EventCategory) bool
}

type EventCategory

type EventCategory uint8

type EventDispatcher

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

func NewEventDispatcher

func NewEventDispatcher(e *Eventum) *EventDispatcher

func (EventDispatcher) Dispatch

func (ed EventDispatcher) Dispatch(fn EventFn) bool

type EventFn

type EventFn struct {
	Event Event
	Fn    func(Eventum) bool
}

type EventType

type EventType int
const (
	NoneType EventType = iota
	WindowClose
	WindowResize
	WindowFocus
	WindowLostFocus
	WindowMoved
	AppTick
	AppUpdate
	AppRender
	KeyPressed
	KeyReleased
	KeyTyped
	MouseButtonPressed
	MouseButtonReleased
	MouseMoved
	MouseScrolled

	NoneCategory = EventCategory(iota)
	EventCategoryApplication
	EventCategoryInput
	EventCategoryKeyboard
	EventCategoryMouse
	EventCategoryMouseButton
)

type Eventum

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

func NewEventum

func NewEventum(ev Event, e EventType) *Eventum

func (*Eventum) Done

func (e *Eventum) Done() bool

func (*Eventum) GetEvent

func (e *Eventum) GetEvent() Event

func (*Eventum) String

func (e *Eventum) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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