Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(s string) (mod tcell.ModMask, key tcell.Key, ch rune, err error)
- type ExtendedFunctionInterface
- type Key
- type KeyPointer
- func (kp *KeyPointer) Bind(keys []string, fn any)
- func (kp *KeyPointer) Execute(tKey *tcell.EventKey, skipExtendedFunction bool) error
- func (kp *KeyPointer) GetExtendedFunctionInterface() *ExtendedFunctionInterface
- func (kp *KeyPointer) IsExtendedFunctionValid() bool
- func (kp *KeyPointer) Release()
- func (kp *KeyPointer) Reset()
- func (kp *KeyPointer) ResetKeyMap()
- func (kp *KeyPointer) ResetKeyMapInAllInstance()
- func (kp *KeyPointer) SetExtendedFunction(e *ExtendedFunctionInterface)
- type MiniBuffer
- func (mb *MiniBuffer) CursorBackward()
- func (mb *MiniBuffer) CursorEnd()
- func (mb *MiniBuffer) CursorForward()
- func (mb *MiniBuffer) CursorHome()
- func (mb *MiniBuffer) Cutoff()
- func (mb *MiniBuffer) DeleteRune()
- func (mb *MiniBuffer) DeleteRuneBackward()
- func (mb *MiniBuffer) Draw()
- func (mb *MiniBuffer) Event(tev *tcell.EventKey) *tcell.EventKey
- func (mb *MiniBuffer) Index() int
- func (mb *MiniBuffer) InsertRune(ch rune)
- func (mb *MiniBuffer) Set(message string, index int)
- func (mb *MiniBuffer) String() string
- func (mb *MiniBuffer) Truncate()
- type MiniBufferPopupmenu
- type Popupmenu
- func (pm *Popupmenu) CursorBackward()
- func (pm *Popupmenu) CursorEnd()
- func (pm *Popupmenu) CursorForward()
- func (pm *Popupmenu) CursorHome()
- func (pm *Popupmenu) Draw()
- func (pm *Popupmenu) Event(tev *tcell.EventKey) *tcell.EventKey
- func (pm *Popupmenu) Index() int
- func (pm *Popupmenu) Item() (int, string)
- func (pm *Popupmenu) Set(items []string, index int)
Constants ¶
const ( LabelCtrl = "ctrl" LabelAlt = "alt" LabelMeta = "meta" LabelShift = "shift" )
Modifier labels
Variables ¶
var ( WorkSpaces []string // directory Switches []string // prefix - Files []string )
Arguments groups
var ( ErrIsNotEventKeyError = errors.New("Not event key error") ErrCodeKeyBound = errors.New("Key bound") ErrCodeExtendedFunction = errors.New("Extended function") ErrCodeFunc = errors.New("VCommand") ErrCodeAction = errors.New("Action") ErrCodeKeyBindingNotFount = errors.New("Key binding not found") ErrCodeUnknownKeyBindingType = errors.New("Unknown key binding type") )
var ErrInvalidKeyEvent = errors.New("invalid key event")
ErrInvalidKeyEvent is the error returned when encoding or decoding a key event fails.
var UnifyEnterKeys = true
UnifyEnterKeys is a flag that determines whether or not KPEnter (keypad enter) key events are interpreted as Enter key events. When enabled, Ctrl+J key events are also interpreted as Enter key events.
Functions ¶
Types ¶
type ExtendedFunctionInterface ¶
type ExtendedFunctionInterface interface { Draw() Event(*tcell.EventKey) *tcell.EventKey }
type KeyPointer ¶
type KeyPointer struct {
// contains filtered or unexported fields
}
func KeyMapper ¶
func KeyMapper() *KeyPointer
KeyMapper provides an entry point for managing key mapping and command execution.
func (*KeyPointer) Bind ¶
func (kp *KeyPointer) Bind(keys []string, fn any)
Bind adds an action associated with the specified key.
func (*KeyPointer) Execute ¶
func (kp *KeyPointer) Execute(tKey *tcell.EventKey, skipExtendedFunction bool) error
Execute executes the action associated with the specified key. SkipExtendedFunction should be set to true mainly in the following cases - Prioritize processing over ExtendedFunctions - when calling from inside ExtendedFunctions
func (*KeyPointer) GetExtendedFunctionInterface ¶
func (kp *KeyPointer) GetExtendedFunctionInterface() *ExtendedFunctionInterface
func (*KeyPointer) IsExtendedFunctionValid ¶
func (kp *KeyPointer) IsExtendedFunctionValid() bool
func (*KeyPointer) Release ¶
func (kp *KeyPointer) Release()
func KeyMapper() Release the KeyPointer created with
func (*KeyPointer) Reset ¶
func (kp *KeyPointer) Reset()
Reset resets the current keymap to the root keymap. Exit from ExtendedFunction
func (*KeyPointer) ResetKeyMap ¶
func (kp *KeyPointer) ResetKeyMap()
Reset resets the current keymap to the root keymap.
func (*KeyPointer) ResetKeyMapInAllInstance ¶
func (kp *KeyPointer) ResetKeyMapInAllInstance()
ResetKeyMapInAllInstance resets the current keymap of all KeyPointer instances created with func KeyMapper() to the root keymap.
func (*KeyPointer) SetExtendedFunction ¶
func (kp *KeyPointer) SetExtendedFunction(e *ExtendedFunctionInterface)
type MiniBuffer ¶
type MiniBuffer struct { *KeyPointer // contains filtered or unexported fields }
bufferIndex is buffer[bufferIndex] Matches the edit cursor position In echo mode, buffer[bufferIndex] becomes the drawing start position drawStartIndex
func NewMiniBuffer ¶
func NewMiniBuffer(message string, prefix string, echo bool) *MiniBuffer
Create and initialize a new MiniBuffer instance.
parameters:
- message: Message to display in the minibuffer.
- prefix: String displayed as prefix.
- echo: echo flag. Specifies whether to echo the contents of the minibuffer.
Return value: initialized MiniBuffer instance.
func (*MiniBuffer) CursorBackward ¶
func (mb *MiniBuffer) CursorBackward()
func (*MiniBuffer) CursorEnd ¶
func (mb *MiniBuffer) CursorEnd()
func (*MiniBuffer) CursorForward ¶
func (mb *MiniBuffer) CursorForward()
func (*MiniBuffer) CursorHome ¶
func (mb *MiniBuffer) CursorHome()
func (*MiniBuffer) Cutoff ¶
func (mb *MiniBuffer) Cutoff()
Cutoff: Remove characters after the cursor position.
func (*MiniBuffer) DeleteRune ¶
func (mb *MiniBuffer) DeleteRune()
func (*MiniBuffer) DeleteRuneBackward ¶
func (mb *MiniBuffer) DeleteRuneBackward()
func (*MiniBuffer) Draw ¶
func (mb *MiniBuffer) Draw()
Draw MiniBuffer and update MiniBuffer.drawStartIndex, MiniBuffer.drawEndIndex
func (*MiniBuffer) Event ¶
func (mb *MiniBuffer) Event(tev *tcell.EventKey) *tcell.EventKey
func (*MiniBuffer) Index ¶
func (mb *MiniBuffer) Index() int
func (*MiniBuffer) InsertRune ¶
func (mb *MiniBuffer) InsertRune(ch rune)
func (*MiniBuffer) Set ¶
func (mb *MiniBuffer) Set(message string, index int)
func (*MiniBuffer) Truncate ¶
func (mb *MiniBuffer) Truncate()
Truncate: Remove characters before the cursor position.
type MiniBufferPopupmenu ¶
type MiniBufferPopupmenu struct { // contains filtered or unexported fields }
func NewMiniBufferPopupmenu ¶
func NewMiniBufferPopupmenu(message string, prefix string, echo bool) *MiniBufferPopupmenu
func (*MiniBufferPopupmenu) Draw ¶
func (m *MiniBufferPopupmenu) Draw()
func (*MiniBufferPopupmenu) Event ¶
func (m *MiniBufferPopupmenu) Event(eKey *tcell.EventKey) *tcell.EventKey
func (*MiniBufferPopupmenu) IsShowPopupmenu ¶
func (m *MiniBufferPopupmenu) IsShowPopupmenu() bool
func (*MiniBufferPopupmenu) ShowPopupmenu ¶
func (m *MiniBufferPopupmenu) ShowPopupmenu(b bool)
type Popupmenu ¶
type Popupmenu struct { // contains filtered or unexported fields }
func (*Popupmenu) CursorBackward ¶
func (pm *Popupmenu) CursorBackward()
func (*Popupmenu) CursorForward ¶
func (pm *Popupmenu) CursorForward()
func (*Popupmenu) CursorHome ¶
func (pm *Popupmenu) CursorHome()