keyboard

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package keyboard exposes access to displaying and hiding the keyboard.

input := textinput.New(ctx, "input")
input.Text = v.text
input.KeyboardType = keyboard.URLType
input.KeyboardAppearance = keyboard.DarkAppearance
input.KeyboardReturnType = keyboard.GoogleReturnType
input.Responder = v.responder

button := ...
button.OnTap = func() {
	v.responder.Dismiss()
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appearance

type Appearance int

Appearance defines the appearance of the keyboard.

const (
	// Default keyboard appearnce
	DefaultAppearance Appearance = iota
	// Light keyboard appearance
	LightAppearance
	// Dark keyboard appearance
	DarkAppearance
)

func (Appearance) MarshalProtobuf

func (a Appearance) MarshalProtobuf() keyboard.Appearance

type Responder

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

Responder is a model object that represents the keyboard's state. To use Responder it must be attached to a textinput.View.

func (*Responder) Dismiss

func (g *Responder) Dismiss()

Dismiss hides any displayed keyboards.

func (*Responder) Notify

func (g *Responder) Notify(f func()) comm.Id

Notify implements comm.Notifier.

func (*Responder) Show

func (g *Responder) Show()

Show displays the keyboard.

func (*Responder) Unnotify

func (g *Responder) Unnotify(id comm.Id)

Unnotify implements comm.Notifier.

func (*Responder) Visible

func (g *Responder) Visible() bool

Visible returns true if the keyboard is visible.

type ReturnType

type ReturnType int

ReturnType defines the keyboard return key style

const (
	DefaultReturnType ReturnType = iota
	GoReturnType
	GoogleReturnType
	JoinReturnType
	NextReturnType
	RouteReturnType
	SearchReturnType
	SendReturnType
	YahooReturnType
	DoneReturnType
	EmergencyCallReturnType
	ContinueReturnType
)

func (ReturnType) MarshalProtobuf

func (t ReturnType) MarshalProtobuf() keyboard.ReturnType

type Type

type Type int

Type defines the kind of keyboard.

const (
	// Default
	DefaultType Type = iota
	// Numbers
	NumberType
	// Numbers + Punctuation
	NumberPunctuationType
	// Numbers + '.'
	DecimalType
	// Numbers + Phone keys
	PhoneType
	// Ascii
	ASCIIType
	// Ascii + '@' + '.'
	EmailType
	// Ascii + '.' + '/' + '.com'
	URLType
	// Ascii + '.' + 'go'
	WebSearchType
	// Ascii + Phone
	NamePhoneType
)

func (Type) MarshalProtobuf

func (t Type) MarshalProtobuf() keyboard.Type

Jump to

Keyboard shortcuts

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