keys

package
v0.0.0-...-0cbbf0d Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Command  string
	Sequence keysequence.KeySequence
}

Binding holds a parsed, user provided key sequence.

type Sequencer

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

Sequencer holds all the keyboard bindings and their action mappings.

func NewSequencer

func NewSequencer() *Sequencer

NewSequencer returns Sequencer.

func (*Sequencer) AddBind

func (s *Sequencer) AddBind(seq keysequence.KeySequence, command string) error

AddBind creates a new key mapping.

func (*Sequencer) KeyInput

func (s *Sequencer) KeyInput(ev *tcell.EventKey) bool

KeyInput feeds a keypress to the sequencer. Returns true if there is one match or more, or false if there is no match.

func (*Sequencer) Match

func (s *Sequencer) Match() *Binding

Match returns a key binding if the current input sequence is found.

func (*Sequencer) RemoveBind

func (s *Sequencer) RemoveBind(seq keysequence.KeySequence) error

RemoveBind removes a key mapping.

func (*Sequencer) String

func (s *Sequencer) String() string

String returns the current input sequence as a string.

Jump to

Keyboard shortcuts

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