event

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

View Source
const (
	GeneralType int
	KeyboardType
	ButtonType
	MotionType
	MenuType
	ConfigureType
)

Event types

View Source
const (
	ButtonActionPress   = 4
	ButtonActionDouble  = 5
	ButtonActionTriple  = 6
	ButtonActionRelease = 7
)

Button action type

View Source
const (
	ButtonLeft   = 1
	ButtonMiddle = 2
	ButtonRight  = 3
)

Button number

Variables

View Source
var (
	UnknownEvent = General{Event: 0}
	DestroyEvent = General{Event: 1}
)

Signal events

View Source
var (
	KeyLeft      = Keyboard{Name: "Left"}
	KeyRight     = Keyboard{Name: "Right"}
	KeyUp        = Keyboard{Name: "Up"}
	KeyDown      = Keyboard{Name: "Down"}
	KeyBackSpace = Keyboard{Rune: 8, Name: "BackSpace"}
	KeyTab       = Keyboard{Rune: 9, Name: "Tab"}
	KeyEnter     = Keyboard{Rune: 13, Name: "Return"}
	KeyDelete    = Keyboard{Rune: 127, Name: "Delete"}
)

Keyboard events

View Source
var (
	KeySave = KeyboardEvent{Rune: 115, Name: "s", Meta: true}
	KeyExit = KeyboardEvent{Rune: 113, Name: "q", Meta: true}
)

Platform specified keyboard events

Functions

This section is empty.

Types

type Button

type Button struct {
	Action int
	Button int
	Point  image.Point
}

Button is mouse button event

func (Button) Type

func (e Button) Type() int

Type returns event type

type Configure

type Configure struct {
	Size image.Point
}

Configure event

func (Configure) Type

func (e Configure) Type() int

Type returns event type

type Eventer

type Eventer interface {
	Type() int
}

Eventer is the interface that groups GUI events

type General

type General struct {
	Event int
}

General is a general purpose notification

func (General) Type

func (e General) Type() int

Type returns event type

type Keyboard

type Keyboard struct {
	Rune    rune
	Shift   bool
	Control bool
	Alt     bool
	Meta    bool
	Name    string
}

Keyboard is a keyboard event

func (Keyboard) IsGraphic

func (e Keyboard) IsGraphic() bool

IsGraphic tests printable rune

func (Keyboard) Type

func (e Keyboard) Type() int

Type returns event type

type Menu struct {
	Action string
}

Menu is menu action event

func NewMenu

func NewMenu(short string) Menu

NewMenu returns a menu action event

func (e Menu) Type() int

Type returns event type

type Motion

type Motion struct {
	Point   image.Point
	Shift   bool
	Control bool
	Alt     bool
	Meta    bool
}

Motion is mouse motion event

func (Motion) Type

func (e Motion) Type() int

Type returns event type

Jump to

Keyboard shortcuts

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