Documentation ¶
Index ¶
Constants ¶
const ( MotionState keybindMapping = iota InputState )
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 ¶
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.