touch

package
v0.0.0-...-5f41422 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 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_Action = kit.Enums.AddEnum(ActionN, false, nil)

Functions

This section is empty.

Types

type Action

type Action int32

Action 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 Action = 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

	ActionN
)

func StringToAction

func StringToAction(s string) (Action, error)

func (Action) String

func (i Action) 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 Action
}

touch.Event is a touch event.

func (Event) EventHasPos

func (ev Event) EventHasPos() bool

func (Event) EventOnFocus

func (ev Event) EventOnFocus() bool

func (Event) EventPos

func (ev Event) EventPos() image.Point

func (Event) EventType

func (ev Event) EventType() 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