Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelled = errors.New("cancelled by user")
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor interface { MoveCursorUp(lines int) MoveCursorDown(lines int) MoveCursorLeft(columns int) MoveCursorRight(columns int) MoveCursorToStartOfLine() HideCursor() ShowCursor() }
Cursor is a base component for UX components that require cursor manipulation.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is a base component for UX components that require user input.
func (*Input) ReadInput ¶
func (i *Input) ReadInput(ctx context.Context, config *InputConfig, handler KeyPressEventHandler) error
ReadInput reads user input from the keyboard.
type InputConfig ¶
type KeyPressEventArgs ¶
type KeyPressEventHandler ¶
type KeyPressEventHandler func(args *KeyPressEventArgs) (bool, error)
KeyPressEventHandler is a function type that handles key press events. Return true to continue listening for key presses, false to stop.
Click to show internal directories.
Click to hide internal directories.