builtin

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actions

func Actions(ctx context.Context, c ui.Creator) ([]input.Action, error)

Types

type Applier

type Applier interface {
	Apply([]rune) input.Operation
}

type Defaulter

type Defaulter interface {
	DefaultEvent() string
}

Defaulter is a type which can provide a default key binding for the reference Handler implementation.

DefaultEvent must return a string representation of the event with keys separated by dashes, e.g. ctrl-s or alt-f.

type Deleter

type Deleter interface {
	Delete(int) input.Operation
}

type Handler

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

Handler is a (pkg/input).Handler implementation that handles basic key bindings and keyboard input. It isn't intended for heavily customized configurations, so key bindings are limited to a single event, and no modes are supported.

This can be overridden in plugins, so if you're looking for key chords (emacs) or modes (vim), someone may have written one - or you can write one yourself.

func NewHandler

func NewHandler(ctx context.Context, c ui.Creator) *Handler

func (*Handler) CharInput

func (h *Handler) CharInput(ctx context.Context, b input.Binder, r rune)

CharInput implements (pkg/input).Handler

func (*Handler) KeyPressed

func (h *Handler) KeyPressed(ctx context.Context, b input.Binder, ev input.KeyEvent)

KeyPressed implements (pkg/input).Handler.

func (*Handler) Name

func (h *Handler) Name(context.Context) string

func (*Handler) SetDefaultKeys

func (h *Handler) SetDefaultKeys(ctx context.Context, b input.Binder, a input.Action)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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