Documentation
¶
Overview ¶
Package getkey retrieves a single key press from the terminal and translates it into a descriptive string.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKey ¶
GetKey waits for the user to press a key and then returns a string describing what was pressed. Alphanumeric characters and punctuation are represented as themselves. Modifier keys are represented as Ctrl-, Alt-, Esc-, and Shift- prefixes (in that order) on the base key. For example, holding down Control and Alt while pressing the L key produces "Ctrl-Alt-L".
func Restore ¶
func Restore() (err error)
Restore restores the terminal to the state it was in during init().
You don't usually need to call this function because GetKey calls it automatically when it returns. However, it can be helpful to call during program exit if GetKey was running in a separate goroutine.
Types ¶
This section is empty.