gesture

package
v0.0.0-...-6902453 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WatchGestureEvent

func WatchGestureEvent(n node.Node, handlers ...Handler) func()

Types

type EventsAccessor

type EventsAccessor interface {
	GestureEvents() *event.Events[Gesture]
}

type FocusedChecker

type FocusedChecker interface {
	Focused() bool
}

type Gesture

type Gesture int
const (
	Press Gesture = iota + 10
	Tap
	Release

	DoubleTap
	LongPress
)
const (
	MouseEnter Gesture = iota + 20
	Hover
	MouseLeave
)
const (
	Focus Gesture = iota + 30
	Blur
)

type Handler

type Handler = event.Handler[Gesture]

func OnBlur

func OnBlur(action func()) Handler

func OnDoubleTap

func OnDoubleTap(action func()) Handler

func OnFocus

func OnFocus(action func()) Handler

func OnHover

func OnHover(action func()) Handler

func OnLongPress

func OnLongPress(action func()) Handler

func OnMouseEnter

func OnMouseEnter(action func()) Handler

func OnMouseLeave

func OnMouseLeave(action func()) Handler

func OnPress

func OnPress(action func()) Handler

func OnPressWithEvent

func OnPressWithEvent(action func(event *PointerData)) Handler

func OnRelease

func OnRelease(action func()) Handler

func OnReleaseWithEvent

func OnReleaseWithEvent(action func(p *PointerData)) Handler

func OnTap

func OnTap(action func()) Handler

func OnTapWithEvent

func OnTapWithEvent(action func(event *PointerData)) Handler

type PointerData

type PointerData struct {
	// Position related of element
	Position  unit.Point
	Modifiers key.Modifiers
	Target    node.Node
}

type PointerEventDetector

type PointerEventDetector struct {
	widget.Clickable
	// contains filtered or unexported fields
}

func (*PointerEventDetector) BindFocusedChecker

func (d *PointerEventDetector) BindFocusedChecker(fc FocusedChecker)

func (*PointerEventDetector) GestureEvents

func (d *PointerEventDetector) GestureEvents() *event.Events[Gesture]

func (*PointerEventDetector) LayoutChild

func (d *PointerEventDetector) LayoutChild(gtx giolayout.Context, n node.Node, child giolayout.Widget) (dims layout.Dimensions)

type State

type State[T comparable] struct {
	Value   T
	Changed bool
}

func (*State[T]) Set

func (once *State[T]) Set(v T)

Jump to

Keyboard shortcuts

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