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
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 ¶
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
Types ¶
type KeyMapHelp ¶
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
Click to show internal directories.
Click to hide internal directories.