Documentation
¶
Overview ¶
Package input implements vim-style copy mode for TUIOS.
Package input implements vim-style copy mode for TUIOS.
Package input implements vim-style copy mode for TUIOS.
Package input implements vim-style copy mode for TUIOS.
Package input implements vim-style copy mode for TUIOS.
Package input implements vim-style copy mode for TUIOS.
Package input implements TUIOS input handling and key forwarding.
This module handles keyboard input in both Window Management and Terminal modes.
Package input implements key mapping definitions and ANSI escape sequence builders for TUIOS.
This module handles: - Converting Bubble Tea KeyPressMsg to raw terminal bytes - ANSI/VT escape sequence generation for terminal compatibility - Function key support with modifier combinations - macOS Option key character mappings
Package input implements keyboard event handling for TUIOS.
Package input implements mouse event handling for TUIOS.
Package input implements text selection logic for TUIOS.
Index ¶
- Constants
- func BuildANSISequence(msg tea.KeyPressMsg) string
- func ForwardKeyToTerminal(msg tea.KeyPressMsg, w interface{ ... }) tea.Cmd
- func HandleCopyModeKey(msg tea.KeyPressMsg, o *app.OS, window *terminal.Window) (*app.OS, tea.Cmd)
- func HandleCopyModeMouseClick(cm *terminal.CopyMode, window *terminal.Window, clickX, clickY int)
- func HandleCopyModeMouseDrag(cm *terminal.CopyMode, window *terminal.Window, startX, startY int)
- func HandleCopyModeMouseMotion(cm *terminal.CopyMode, window *terminal.Window, mouseX, mouseY int) int
- func HandleDebugPrefixCommand(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleInput(msg tea.Msg, o *app.OS) (tea.Model, tea.Cmd)
- func HandleKeyPress(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleMinimizePrefixCommand(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandlePrefixCommand(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleScrollbackBrowserKey(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleTapePrefixCommand(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleTerminalModeKey(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleTilingPrefixCommand(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleWindowManagementModeKey(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func HandleWorkspacePrefixCommand(msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
- func IsMacOSOptionKey(r rune) (digit int, ok bool)
- func IsMacOSOptionShiftKey(r rune) (digit int, ok bool)
- func IsMacOSOptionTab(r rune) string
- func MoveDown(cm *terminal.CopyMode, window *terminal.Window)
- func MoveLeft(cm *terminal.CopyMode, window *terminal.Window)
- func MoveRight(cm *terminal.CopyMode, window *terminal.Window)
- func MoveUp(cm *terminal.CopyMode, window *terminal.Window)
- func OpenScrollbackBrowser(o *app.OS)
- func UpdateVisualEnd(cm *terminal.CopyMode, window *terminal.Window)
- type ActionDispatcher
- type ActionHandler
Constants ¶
const PrefixKeyTimeout = 2 * time.Second
PrefixKeyTimeout is the duration after which prefix mode times out
Variables ¶
This section is empty.
Functions ¶
func BuildANSISequence ¶
func BuildANSISequence(msg tea.KeyPressMsg) string
BuildANSISequence is a public helper that builds an ANSI escape sequence for a key. This can be useful for testing or debugging key sequences.
func ForwardKeyToTerminal ¶
ForwardKeyToTerminal is a convenience function that can be called to forward a key directly to a terminal window. This is useful for implementing key forwarding in other parts of the application.
func HandleCopyModeKey ¶ added in v0.0.16
HandleCopyModeKey is the main dispatcher for copy mode input
func HandleCopyModeMouseClick ¶ added in v0.0.16
HandleCopyModeMouseClick handles mouse clicks in copy mode
func HandleCopyModeMouseDrag ¶ added in v0.0.16
HandleCopyModeMouseDrag handles mouse drag start in copy mode (initiates visual selection)
func HandleCopyModeMouseMotion ¶ added in v0.0.16
func HandleCopyModeMouseMotion(cm *terminal.CopyMode, window *terminal.Window, mouseX, mouseY int) int
HandleCopyModeMouseMotion handles mouse motion during drag in copy mode. Returns the auto-scroll direction: -1 (up), 0 (none), 1 (down).
func HandleDebugPrefixCommand ¶ added in v0.0.23
HandleDebugPrefixCommand handles debug prefix commands (Ctrl+B, D, ...) in window management mode
func HandleInput ¶
HandleInput is the main input coordinator that routes messages to appropriate handlers
func HandleKeyPress ¶
HandleKeyPress handles all keyboard input and routes to mode-specific handlers
func HandleMinimizePrefixCommand ¶
HandleMinimizePrefixCommand handles minimize prefix commands (Ctrl+B, m, ...)
func HandlePrefixCommand ¶
HandlePrefixCommand handles prefix commands (Ctrl+B followed by another key)
func HandleScrollbackBrowserKey ¶ added in v0.7.0
HandleScrollbackBrowserKey handles keyboard input when the scrollback browser is open.
func HandleTapePrefixCommand ¶ added in v0.4.0
HandleTapePrefixCommand handles tape prefix commands (Ctrl+B, T, ...) in window management mode
func HandleTerminalModeKey ¶
HandleTerminalModeKey handles keyboard input in terminal mode
func HandleTilingPrefixCommand ¶
HandleTilingPrefixCommand handles tiling/window prefix commands (Ctrl+B, t, ...) in window management mode
func HandleWindowManagementModeKey ¶
HandleWindowManagementModeKey handles keyboard input in window management mode
func HandleWorkspacePrefixCommand ¶
HandleWorkspacePrefixCommand handles workspace prefix commands (Ctrl+B, w, ...)
func IsMacOSOptionKey ¶
IsMacOSOptionKey checks if a rune represents a macOS Option+digit key press and returns the digit (1-9) and true if it matches, or 0 and false otherwise.
macOS Option key mappings: Option+1 → ¡, Option+2 → ™, Option+3 → £, Option+4 → ¢, Option+5 → ∞ Option+6 → §, Option+7 → ¶, Option+8 → •, Option+9 → ª
func IsMacOSOptionShiftKey ¶
IsMacOSOptionShiftKey checks if a rune represents a macOS Option+Shift+digit key press and returns the digit (1-9) and true if it matches, or 0 and false otherwise.
macOS Option+Shift key mappings: Option+Shift+1 → ⁄, Option+Shift+2 → €, Option+Shift+3 → ‹, Option+Shift+4 → › Option+Shift+5 → fi, Option+Shift+6 → fl, Option+Shift+7 → ‡, Option+Shift+8 → ° Option+Shift+9 → ·
func IsMacOSOptionTab ¶ added in v0.6.0
IsMacOSOptionTab checks if a rune represents a macOS Option+Tab or Option+Shift+Tab key press. Returns "next" for opt+tab (⇥), "prev" for opt+shift+tab (⇤), or "" if no match.
macOS Option+Tab mappings: Option+Tab → ⇥ (U+21E5, Rightwards Arrow to Bar) Option+Shift+Tab → ⇤ (U+21E4, Leftwards Arrow to Bar)
func OpenScrollbackBrowser ¶ added in v0.7.0
OpenScrollbackBrowser opens the scrollback browser for the focused terminal window.
Types ¶
type ActionDispatcher ¶ added in v0.0.23
type ActionDispatcher struct {
// contains filtered or unexported fields
}
ActionDispatcher maps action names to handler functions
func GetDispatcher ¶ added in v0.0.23
func GetDispatcher() *ActionDispatcher
GetDispatcher returns the global action dispatcher
func NewActionDispatcher ¶ added in v0.0.23
func NewActionDispatcher() *ActionDispatcher
NewActionDispatcher creates a new action dispatcher with all handlers registered
func (*ActionDispatcher) Dispatch ¶ added in v0.0.23
func (d *ActionDispatcher) Dispatch(action string, msg tea.KeyPressMsg, o *app.OS) (*app.OS, tea.Cmd)
Dispatch executes the handler for a given action
func (*ActionDispatcher) HasAction ¶ added in v0.0.23
func (d *ActionDispatcher) HasAction(action string) bool
HasAction checks if an action is registered
func (*ActionDispatcher) Register ¶ added in v0.0.23
func (d *ActionDispatcher) Register(action string, handler ActionHandler)
Register adds an action handler
type ActionHandler ¶ added in v0.0.23
ActionHandler is a function that handles a specific action