mapkeys

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mapkeys provides a widget that can map one keypress to a sequence of keypresses. If the user pnovides as input a key that is mapped, the sequence of resulting keypresses is played to the subwidget before control returns. If the key is not mapped, it is passed through as normal. I'm going to use this to provide a vim-like macro feature in termshark.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Widget

type Widget struct {
	gowid.IWidget
	// contains filtered or unexported fields
}

func New

func New(w gowid.IWidget) *Widget

func (*Widget) AddMapping

func (w *Widget) AddMapping(from vim.KeyPress, to vim.KeySequence, app gowid.IApp)

func (*Widget) ClearMappings

func (w *Widget) ClearMappings(app gowid.IApp)

ClearMappings will remove all mappings. I deliberately preserve the same dictionary, though in case I decide in the future it's useful to let clients have direct access to the map (and so maybe store it somewhere).

func (*Widget) RemoveMapping

func (w *Widget) RemoveMapping(from vim.KeyPress, app gowid.IApp)

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

Jump to

Keyboard shortcuts

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