gesture

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Axis

type Axis = gesture.Axis
const (
	Horizontal Axis = gesture.Horizontal
	Vertical   Axis = gesture.Vertical
	Both       Axis = gesture.Both
)

type Click

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

Click detects click gestures in the form of ClickEvents.

func (*Click) Add

func (c *Click) Add(ops *op.Ops)

Add the handler to the operation list to receive click events.

func (*Click) Hovered

func (c *Click) Hovered() bool

Hovered returns whether a pointer is inside the area.

func (*Click) Pressed

func (c *Click) Pressed(btn pointer.Buttons) bool

Pressed returns whether a pointer is pressing.

func (*Click) Update added in v0.4.0

func (c *Click) Update(q event.Queue) []ClickEvent

Update state and return the click events.

type ClickEvent

type ClickEvent struct {
	Kind      ClickKind
	Position  image.Point
	Source    pointer.Source
	Modifiers key.Modifiers
	Button    pointer.Buttons
	// NumClicks records successive clicks occurring
	// within a short duration of each other.
	NumClicks int
}

ClickEvent represent a click action, either a KindPress for the beginning of a click or a KindClick for a completed click.

func (ClickEvent) ImplementsEvent

func (ClickEvent) ImplementsEvent()

type ClickKind added in v0.4.0

type ClickKind uint8
const (
	// KindPress is reported for the first pointer
	// press.
	KindPress ClickKind = iota
	// KindClick is reported when a click action
	// is complete.
	KindClick
	// KindCancel is reported when the gesture is
	// cancelled.
	KindCancel
)

type Drag

type Drag = gesture.Drag

type Hover

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

Hover detects hover events and tracks the pointer's position.

func (*Hover) Add

func (h *Hover) Add(ops *op.Ops)

Add the handler to the operation list to detect hovering.

func (*Hover) Pointer

func (h *Hover) Pointer() f32.Point

func (*Hover) Update

func (h *Hover) Update(q event.Queue) bool

Jump to

Keyboard shortcuts

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