func (s *Sequencer) KeyInput(ev *tcell.EventKey, contexts []string) bool {
	log.Debugf("Key event: %s", keysequence.FormatKey(ev))
	s.input = append(s.input, ev)
	if len(s.findAll(s.input, contexts)) == 0 {
		s.input = make(keysequence.KeySequence, 0)
		return false
	}
	return true
}
KeyInput feeds a keypress to the sequencer. Returns true if there is one match or more, or false if there is no match.
package keys
import (
	"fmt"
	"github.com/ambientsound/visp/log"
	"github.com/ambientsound/visp/keysequence"
	"github.com/gdamore/tcell/v2"
)
type Binding struct {
	Command  string
	Context  string
	Sequence keysequence.KeySequence
}
type Sequencer struct {
	binds []Binding
	event *tcell.EventKey
	input keysequence.KeySequence
}
func NewSequencer() *Sequencer {
	return &Sequencer{
		binds: make([]Binding, 0),
		input: make(keysequence.KeySequence, 0),
	}
}
func (s *Sequencer) AddBind(binding Binding) error {
	if s.dupes(binding) {
		return fmt.Errorf("can't bind: conflicting with already bound key sequence")
	}
	s.binds = append(s.binds, binding)
	return nil
}
func (s *Sequencer) RemoveBind(context string, seq keysequence.KeySequence) error {
	for i := range s.binds {
		if context != s.binds[i].Context {
			continue
		}
		if !keysequence.Compare(s.binds[i].Sequence, seq) {
			continue
		}
		s.binds[i] = s.binds[len(s.binds)-1]
		s.binds = s.binds[:len(s.binds)-1]
		return nil
	}
	return fmt.Errorf("can't unbind: sequence not bound")
}