mouse

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mouse demonstrates the click, double-click, wheel and drag affordances tuilib components expose when the app shell enables mouse input (app.Options.Mouse = app.MouseClick).

Nothing here is mouse-specific plumbing: the screen holds three ordinary components in a focus.Group and routes messages the usual way. Every behaviour below falls out of components knowing the rect layout gave them.

What to try:

  • Click any pane to focus it — the border flips to its active colour.
  • Click a row to move the cursor there; double-click to open it, the mouse spelling of enter (rule 14).
  • Click a sortable table header to sort by it; click again to flip.
  • Click a ▸/▾ glyph in the tree to expand or collapse that node. One click, because the glyph is drawn to say "this opens".
  • Roll the wheel over any pane — including an unfocused one. The wheel does what ↓/j does for that component and never steals focus.
  • Drag a scrollbar thumb, or click anywhere on its track to jump.
  • Click a breadcrumb crumb to jump back up the stack, and the "? help" affordance in the statusbar to open the panel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the mouse demo's root screen.

Types

type Screen

type Screen struct {
	// contains filtered or unexported fields
}

func (*Screen) Help

func (s *Screen) Help() []key.Binding

func (*Screen) Init

func (s *Screen) Init() tea.Cmd

func (*Screen) IsCapturingKeys

func (s *Screen) IsCapturingKeys() bool

func (*Screen) Layout

func (s *Screen) Layout() layout.Node

func (*Screen) OnEnter

func (s *Screen) OnEnter(any) tea.Cmd

func (*Screen) SetTheme

func (s *Screen) SetTheme(t theme.Theme)

func (*Screen) Title

func (s *Screen) Title() string

func (*Screen) Update

func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)

Jump to

Keyboard shortcuts

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