Documentation
¶
Overview ¶
Package event defines various types of GUI events
Index ¶
Constants ¶
View Source
const ( GeneralType int // GeneralType represents a general event type KeyboardType // KeyboardType represents a keyboard event type ButtonType // ButtonType represents a mouse button event type MotionType // MotionType represents a mouse motion event type MenuType // MenuType represents a menu action event type ConfigureType // ConfigureType represents a window configuration event type ScrollType // ScrollType represents a scroll event type ClipboardType // ClipboardType represents a clipboard event type )
Event types.
View Source
const ( ButtonActionPress = 4 // ButtonActionPress represents a button press action ButtonActionDouble = 5 // ButtonActionDouble represents a double-click action ButtonActionTriple = 6 // ButtonActionTriple represents a triple-click action ButtonActionRelease = 7 // ButtonActionRelease represents a button release action )
Button action types.
View Source
const ( ButtonLeft = 1 // ButtonLeft represents the left mouse button ButtonMiddle = 2 // ButtonMiddle represents the middle mouse button ButtonRight = 3 // ButtonRight represents the right mouse button )
Button numbers.
View Source
const ( ScrollUp = 0 // ScrollUp represents scrolling up ScrollDown = 1 // ScrollDown represents scrolling down ScrollLeft = 2 // ScrollLeft represents scrolling left ScrollRight = 3 // ScrollRight represents scrolling right ScrollSmooth = 4 // ScrollSmooth represents smooth scrolling )
Scroll direction types.
Variables ¶
View Source
var ( UnknownEvent = General{Event: 0} // UnknownEvent represents an unknown event DestroyEvent = General{Event: 1} // DestroyEvent represents a destroy event )
Predefined general 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"} )
Predefined 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 // Action represents the button action type Button int // Button represents the mouse button number Point image.Point // Point represents the location of the mouse pointer }
Button represents a mouse button event.
type Clipboard ¶ added in v0.4.0
type Clipboard struct {
Data clipboard.Clipboarder // Data represents the clipboard content
}
Clipboard represents an event with clipboard data.
type Configure ¶
type Configure struct { Size image.Point // Size represents the size of the window InnerSize image.Point // InnerSize represents the size of the inner part of the window }
Configure represents a window configuration event.
type Eventer ¶
type Eventer interface {
Type() int // Type returns the type of GUI event
}
Eventer is the interface that groups GUI events.
type General ¶
type General struct {
Event int // Event identifies the specific general event
}
General represents a general-purpose notification event.
type Keyboard ¶
type Keyboard struct { Rune rune // Rune represents the character input from the keyboard Shift bool // Shift indicates if the Shift key is pressed Control bool // Control indicates if the Control key is pressed Alt bool // Alt indicates if the Alt key is pressed Meta bool // Meta indicates if the Meta key is pressed Name string // Name represents the name of the key }
Keyboard represents a keyboard event.
type Menu ¶
type Menu struct {
Action string // Action represents the menu action command
}
Menu represents a menu action event.
type Motion ¶
type Motion struct { Point image.Point // Point represents the location of the mouse pointer Shift bool // Shift indicates if the Shift key is pressed during motion Control bool // Control indicates if the Control key is pressed during motion Alt bool // Alt indicates if the Alt key is pressed during motion Meta bool // Meta indicates if the Meta key is pressed during motion }
Motion represents a mouse motion event.
Click to show internal directories.
Click to hide internal directories.