Cliutil

package
v0.0.0-...-14468cb Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MotionState keybindMapping = iota
	InputState
)
View Source
const (
	Up         inputKey = "k"
	Down       inputKey = "j"
	Left       inputKey = "h"
	Right      inputKey = "l"
	InputMode  inputKey = "i"
	MotionMode inputKey = "\033" // Escape key is represented by the escape character
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UserControlState

type UserControlState struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UserControlState is the struct that is used to manage the state of the user input. It is used to manage the current mode of the user input, and to lock the user input to a specific mode. UserControlState needs to be declared in the main function of your program, and you can then run the StartInputManager function on the declared UserControlState variable. You can also run the LockModeSwitching and UnlockModeSwitching functions on the declared UserControlState variable to lock and unlock the user input to the current mode.

func (*UserControlState) LockModeSwitching

func (s *UserControlState) LockModeSwitching()

LockModeSwitching is used to lock the user input to the current mode. This is useful for when you want to lock the user input to a specific mode during a specific operation.

func (*UserControlState) StartInputManager

func (s *UserControlState) StartInputManager(initialState keybindMapping, locked bool)

StartInputManager is the main function for the cliutil package for defining controls and managing user input. The StartInputManager function takes two parameters: initialState and locked. The initialState parameter is used to set the default mode of the user input. The locked parameter is used to lock the user input to the current mode. This is useful for when you want to lock the user input to a specific mode during a specific operation.

func (*UserControlState) UnlockModeSwitching

func (s *UserControlState) UnlockModeSwitching()

UnlockModeSwitching is used to unlock the user input to the current mode. This is useful for when you want to unlock the user input.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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