Package sendkeys provides functions to simulate user input in the terminal by
sending keys to a TTY. Useful especially to test terminal programs that run in
raw mode. See the package documentation for details, API reference and
usage example (alternatively, on pkg.go.dev).
type Target struct {
// contains filtered or unexported fields
}
Target represents the tty to which the keys are sent. Create one by calling
Open and send keys using Target.SendRunes or Target.SendBytes. The Target
must be closed after use.
Open returns a Target that sends keys to the specified TTY. The delay is the
time to wait before sending each separate string when SendRunes or SendBytes
is called.
SendRunes sends each rune of each string the the Target. All runes of a
given string are sent without delay, and the target's delay is applied
between each string.