touch

package
v1.3.15 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package touch defines an event for touch input, for the GoGi GUI system.

Index

Constants

This section is empty.

Variables

View Source
var KiT_Actions = kit.Enums.AddEnum(ActionsN, kit.NotBitFlag, nil)

Functions

This section is empty.

Types

type Actions

type Actions int32

Actions describes the action taken for a touch event.

const (
	// Begin is a user first touching the device.
	//
	// On Android, this is a AMOTION_EVENT_ACTION_DOWN.
	// On iOS, this is a call to touchesBegan.
	Begin Actions = iota

	// Move is a user dragging across the device.
	//
	// A TypeMove is delivered between a TypeBegin and TypeEnd.
	//
	// On Android, this is a AMOTION_EVENT_ACTION_MOVE.
	// On iOS, this is a call to touchesMoved.
	Move

	// End is a user no longer touching the device.
	//
	// On Android, this is a AMOTION_EVENT_ACTION_UP.
	// On iOS, this is a call to touchesEnded.
	End

	ActionsN
)

func (*Actions) FromString

func (i *Actions) FromString(s string) error

func (Actions) String

func (i Actions) String() string

type Event

type Event struct {
	oswin.EventBase

	// Where is the touch location, in raw display dots (raw, actual pixels)
	Where image.Point

	// Sequence is the sequence number. The same number is shared by all events
	// in a sequence. A sequence begins with a single Begin, is followed by
	// zero or more Moves, and ends with a single End. A Sequence
	// distinguishes concurrent sequences but its value is subsequently reused.
	Sequence Sequence

	// Action is the touch action
	Action Actions
}

touch.Event is a touch event.

func (*Event) HasPos

func (ev *Event) HasPos() bool

func (*Event) OnFocus

func (ev *Event) OnFocus() bool

func (*Event) Pos

func (ev *Event) Pos() image.Point

func (*Event) Type

func (ev *Event) Type() oswin.EventType

type Sequence

type Sequence int64

Sequence identifies a sequence of touch events.

Jump to

Keyboard shortcuts

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