core

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyScrollMap = map[string]ScrollDirection{
	"up":     ScrollUp,
	"k":      ScrollUp,
	"down":   ScrollDown,
	"j":      ScrollDown,
	"pgup":   ScrollPageUp,
	"pgdown": ScrollPageDown,
	"home":   ScrollToTop,
	"end":    ScrollToBottom,
}

KeyScrollMap maps common scroll keys to directions

View Source
var NavigationKeys = []string{"up", "down", "left", "right", "enter", "esc"}

NavigationKeys are common keys used for navigation that components might want to handle. Note: vim-style keys (h, j, k, l) are intentionally excluded to avoid conflicts with typing in completion popups where users need to type those letters.

Functions

func CmdHandler

func CmdHandler(msg tea.Msg) tea.Cmd

CmdHandler creates a command that returns the given message

func IsNavigationKey added in v1.16.0

func IsNavigationKey(msg tea.KeyPressMsg) bool

IsNavigationKey returns true if the key is a common navigation key

func NewSimpleHelp

func NewSimpleHelp(list []key.Binding) help.KeyMap

NewSimpleHelp creates a new simple help system

Types

type KeyMapHelp

type KeyMapHelp interface {
	Help() help.KeyMap
}

KeyMapHelp interface for components that provide help

type ScrollDirection added in v1.16.0

type ScrollDirection int

ScrollDirection represents the direction of scrolling

const (
	ScrollUp ScrollDirection = iota
	ScrollDown
	ScrollPageUp
	ScrollPageDown
	ScrollToTop
	ScrollToBottom
)

func GetScrollDirection added in v1.16.0

func GetScrollDirection(msg tea.KeyPressMsg) (ScrollDirection, bool)

GetScrollDirection returns the scroll direction for a key press, or -1 if not a scroll key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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