events

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const ClipboardCopyEventType = EventType("clipboard.copy")

ClipboardCopyEventType is the name for events where data shall be written to the clipboard.

View Source
const ClipboardPasteEventType = EventType("clipboard.paste")

ClipboardPasteEventType is the name for events where data shall be read from the clipboard.

View Source
const FileDropEventType = EventType("env.filedrop")

FileDropEventType is the name for events where one or more files are dropped into the user interface.

View Source
const MouseButtonClickedEventType = EventType("mouse.button.clicked")

MouseButtonClickedEventType is the name for events where buttons where clicked without moving the cursor.

View Source
const MouseButtonDownEventType = EventType("mouse.button.down")

MouseButtonDownEventType is the name for events where buttons where pressed.

View Source
const MouseButtonUpEventType = EventType("mouse.button.up")

MouseButtonUpEventType is the name for events where buttons where de-pressed.

View Source
const MouseMoveEventType = EventType("mouse.move")

MouseMoveEventType is the type for mouse move events.

View Source
const MouseScrollEventType = EventType("mouse.scroll")

MouseScrollEventType is the name for events where the mouse scroll function was used.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clipboard added in v0.8.0

type Clipboard interface {
	// Text returns, if available, the current text content of the clipboard.
	Text() string
	// SetText changes the current text content of the clipboard.
	SetText(value string)
}

Clipboard describes access to the clipboard content.

type ClipboardEvent added in v0.8.0

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

ClipboardEvent is the base structure for all clipboard related events.

func NewClipboardEvent added in v0.8.0

func NewClipboardEvent(eventType EventType, x, y float32, clipboard Clipboard) *ClipboardEvent

NewClipboardEvent initializes a basic clipboard event structure.

func (*ClipboardEvent) Clipboard added in v0.8.0

func (event *ClipboardEvent) Clipboard() Clipboard

Clipboard returns access to the clipboard.

func (*ClipboardEvent) EventType added in v0.8.0

func (event *ClipboardEvent) EventType() EventType

EventType implements the Event interface.

func (*ClipboardEvent) Position added in v0.8.0

func (event *ClipboardEvent) Position() (x, y float32)

Position returns the coordinate of the event.

type Event

type Event interface {
	// EventType returns the identifier for the event.
	EventType() EventType
}

Event is the root interface for all UI events. Its EventType property specifies what kind of event it is.

type EventType

type EventType string

EventType is an identifier of events.

type FileDropEvent added in v0.8.0

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

FileDropEvent is used to inform about dropped files.

func NewFileDropEvent added in v0.8.0

func NewFileDropEvent(x, y float32, filePaths []string) *FileDropEvent

NewFileDropEvent initializes a basic clipboard event structure.

func (*FileDropEvent) EventType added in v0.8.0

func (event *FileDropEvent) EventType() EventType

EventType implements the Event interface.

func (*FileDropEvent) FilePaths added in v0.8.0

func (event *FileDropEvent) FilePaths() []string

FilePaths returns the list of file paths

func (*FileDropEvent) Position added in v0.8.0

func (event *FileDropEvent) Position() (x, y float32)

Position returns the coordinate of the event.

type MouseButtonEvent

type MouseButtonEvent struct {
	MouseEvent
	// contains filtered or unexported fields
}

MouseButtonEvent describes an update of buttons of the mouse.

func NewMouseButtonEvent

func NewMouseButtonEvent(eventType EventType, x, y float32, modifier uint32, buttons uint32, affectedButtons uint32) *MouseButtonEvent

NewMouseButtonEvent returns a new instance of a mouse event.

func (*MouseButtonEvent) AffectedButtons

func (event *MouseButtonEvent) AffectedButtons() uint32

AffectedButtons returns the bitmask of the buttons that were affected by the event. The bitmask returned by Buttons() returns the state of the mouse buttons after this event.

type MouseEvent

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

MouseEvent is the base structure for all mouse related events.

func InitMouseEvent

func InitMouseEvent(eventType EventType, x, y float32, modifier uint32, buttons uint32) MouseEvent

InitMouseEvent initializes a basic mouse event structure.

func (*MouseEvent) Buttons

func (event *MouseEvent) Buttons() uint32

Buttons returns a bitmask of currently pressed mouse buttons.

func (*MouseEvent) EventType

func (event *MouseEvent) EventType() EventType

EventType implements the Event interface.

func (*MouseEvent) Modifier

func (event *MouseEvent) Modifier() uint32

Modifier returns a bitmask of currently active keyboard modifier.

func (*MouseEvent) Position

func (event *MouseEvent) Position() (x, y float32)

Position returns the coordinate of the event.

type MouseMoveEvent

type MouseMoveEvent struct {
	MouseEvent
}

MouseMoveEvent describes an update of the position of the mouse.

func NewMouseMoveEvent

func NewMouseMoveEvent(x, y float32, modifier uint32, buttons uint32) *MouseMoveEvent

NewMouseMoveEvent returns a new instance of a mouse event.

type MouseScrollEvent

type MouseScrollEvent struct {
	MouseEvent
	// contains filtered or unexported fields
}

MouseScrollEvent describes a scrolling operation.

func NewMouseScrollEvent

func NewMouseScrollEvent(x, y float32, modifier uint32, buttons uint32, dx, dy float32) *MouseScrollEvent

NewMouseScrollEvent returns a new instance of a mouse event.

func (*MouseScrollEvent) Deltas

func (event *MouseScrollEvent) Deltas() (dx, dy float32)

Deltas returns the offsets of the scrolling operation.

type PositionalEvent

type PositionalEvent interface {
	Event

	// Position returns the location of the event.
	Position() (float32, float32)
}

PositionalEvent is an event happening at a specific position.

Jump to

Keyboard shortcuts

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