event

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

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

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

View Source
const (
	ScrollUp     = 0
	ScrollDown   = 1
	ScrollLeft   = 2
	ScrollRight  = 3
	ScrollSmooth = 4
)

Scroll direction type

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"}
	KeyEscape    = Keyboard{Rune: 27, Name: "Escape"}
	KeySpace     = Keyboard{Rune: 32, Name: "space"}
	KeyDelete    = Keyboard{Rune: 127, Name: "Delete"}
	KeyPageUp    = Keyboard{Name: "Page_Up"}
	KeyPageDown  = Keyboard{Name: "Page_Down"}
	KeyHome      = Keyboard{Name: "Home"}
	KeyEnd       = Keyboard{Name: "End"}
)

Keyboard events

View Source
var (
	KeySave  = Keyboard{Rune: 115, Name: "s", Control: true}
	KeyExit  = Keyboard{Rune: 119, Name: "w", Control: true}
	KeyCopy  = Keyboard{Rune: 99, Name: "c", Control: true}
	KeyPaste = Keyboard{Rune: 118, Name: "v", Control: 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 Clipboard added in v0.4.0

type Clipboard struct {
	Data clipboard.Clipboarder
}

Clipboard is event with clipboard data

func (Clipboard) Type added in v0.4.0

func (c Clipboard) Type() int

Type returns event type

type Configure

type Configure struct {
	Size      image.Point
	InnerSize 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

type Scroll added in v0.2.2

type Scroll struct {
	Direction int
	DeltaX    int
	DeltaY    int
}

Scroll is scroll event

func (Scroll) Type added in v0.2.2

func (e Scroll) Type() int

Type returns event type

Jump to

Keyboard shortcuts

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