Back to godoc.org

Package events

v0.0.0-...-328a337
Latest Go to latest

The highest tagged major version is .

Published: Aug 25, 2020 | License: Apache-2.0 | Module: github.com/kpfaulkner/goui

Index

Constants

const (

	// raw events that will start at window and work their way down.
	// eg, mouse clicked, key pressed on keyboard etc.
	EventTypeButtonDown int = iota
	EventTypeButtonUp
	EventTypeMouseMove
	EventTypeKeyboard
	EventTypeSetText
	EventTypeDeselect // used for checkboxes/radiobuttons etc.

	// events generated from widgets indicating a widget based event
	// eg. image button pressed.
	// Some of these might seem replicated... eg, mouse clicked (on a button) could be
	// seen as the same as "image button pressed"... but one is effectively HW signal coming in
	// where as the the widget events are out going (at least, that's the thought at the moment)
	WidgetEventTypeButtonPressed int = iota
)

type CheckBoxEvent

type CheckBoxEvent struct {
	Event
	Checked bool
}

func NewCheckBoxEvent

func NewCheckBoxEvent(name string, eventType int, checked bool, widgetID string) CheckBoxEvent

func (CheckBoxEvent) Action

func (m CheckBoxEvent) Action() error

func (CheckBoxEvent) EventType

func (m CheckBoxEvent) EventType() int

func (CheckBoxEvent) Name

func (m CheckBoxEvent) Name() string

type DeselectEvent

type DeselectEvent struct {
	Event
}

func NewDeselectEvent

func NewDeselectEvent(widgetID string) DeselectEvent

func (DeselectEvent) Action

func (e DeselectEvent) Action() error

func (DeselectEvent) EventType

func (e DeselectEvent) EventType() int

func (DeselectEvent) Name

func (e DeselectEvent) Name() string

type Event

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

func NewEvent

func NewEvent(eventType int) Event

func (Event) WidgetID

func (e Event) WidgetID() string

type EventListener

type EventListener struct {
}

EventListener is generic event listener that is used in the APP itself and not in the UI widgets etc.

func NewEventListener

func NewEventListener() *EventListener

type IEvent

type IEvent interface {
	Name() string     // some event specific text.
	WidgetID() string // ID of widget generating this event! Unsure if this will be required or not. Suspect not.
	EventType() int
	Action() error
}

type IEventHandler

type IEventHandler interface {
	HandleEvent(event IEvent) error
}

type KeyboardEvent

type KeyboardEvent struct {
	Event
	Character ebiten.Key // yeah yeah, shouldn't really be a string.
}

func NewKeyboardEvent

func NewKeyboardEvent(key ebiten.Key, widgetID string) KeyboardEvent

func (KeyboardEvent) Action

func (e KeyboardEvent) Action() error

func (KeyboardEvent) EventType

func (e KeyboardEvent) EventType() int

func (KeyboardEvent) Name

func (e KeyboardEvent) Name() string

type MouseEvent

type MouseEvent struct {
	Event
	X float64
	Y float64
}

func NewMouseEvent

func NewMouseEvent(name string, x int, y int, eventType int, widgetID string) MouseEvent

func (MouseEvent) Action

func (m MouseEvent) Action() error

func (MouseEvent) EventType

func (m MouseEvent) EventType() int

func (MouseEvent) Name

func (m MouseEvent) Name() string

type SetTextEvent

type SetTextEvent struct {
	Event
	Text string
}

func NewSetTextEvent

func NewSetTextEvent(text string) SetTextEvent

func (SetTextEvent) Action

func (e SetTextEvent) Action() error

func (SetTextEvent) EventType

func (e SetTextEvent) EventType() int

func (SetTextEvent) Name

func (e SetTextEvent) Name() string

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier