humankey

package
v0.0.0-...-5b03d4c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UppercaseSpecialCharset = "!@#$%^&()_+{}:\"<>?|~"

Functions

func PrettyPrintInternalKey

func PrettyPrintInternalKey(key InternalKey) string

func PrettyPrintSequence

func PrettyPrintSequence(seq []InternalKey) string

Types

type HumanKeymap

type HumanKeymap map[string]map[string]string

func (HumanKeymap) ToInternal

func (h HumanKeymap) ToInternal() (InternalKeymap, error)

type InternalKey

type InternalKey struct {
	Key     tcell.Key
	Rune    rune
	ModMask tcell.ModMask
}

func Parse

func Parse(s string) (InternalKey, error)

func ParseSequence

func ParseSequence(s string) ([]InternalKey, error)

func (InternalKey) Matches

func (i InternalKey) Matches(event tcell.EventKey) bool

func (InternalKey) MatchesInternal

func (i InternalKey) MatchesInternal(key InternalKey) bool

type InternalKeymap

type InternalKeymap map[string][]InternalKeymapEntry

func (InternalKeymap) GetMatches

func (ik InternalKeymap) GetMatches(mode string, currentSequence []InternalKey) []InternalKeymapEntry

func (InternalKeymap) MergeInternal

func (ik InternalKeymap) MergeInternal(others ...InternalKeymap) InternalKeymap

Merges target with other keymaps. other keymaps have priority over the target, and order matters.

type InternalKeymapEntry

type InternalKeymapEntry struct {
	Sequence []InternalKey
	Command  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳