keyboard

– import “gomatcha.io/matcha/keyboard”

Package keyboard exposes access to displaying and hiding the keyboard.

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

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

type Responder

type Responder struct {
}

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 Type

type Type int

Type defines the kind of keyboard.

const (
	TextType Type = iota
	NumberType
	EmailType
	URLType
	PhoneType
)

func (Type) MarshalProtobuf

func (t Type) MarshalProtobuf() keyboard.Type