touch

package
v2.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package touch defines an event for touch input.

See the golang.org/x/mobile/app package for details on the event model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// X and Y are the touch location, in pixels.
	X, Y float32

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

	// Type is the touch type.
	Type Type
}

Event is a touch event.

type Sequence

type Sequence int64

Sequence identifies a sequence of touch events.

type Type

type Type byte

Type describes the type of a touch event.

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

	// TypeMove 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.
	TypeMove

	// TypeEnd 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.
	TypeEnd
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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