go-keyboardemulator
is only available for Windows for now. Linux will come next and hopefully MAC OSX too :D
go-keyboardemulator
is a cross-OS keyboard emulator that can take control of your keyboard through code for the GO programming language (http://golang.org).
Run the following command:
$ go get github.com/asticode/go-keyboardemulator/keyboardemulator
To make this test effective, create a new text document, open it, come back to your shell with ALT+TAB and execute the following code
// Create a keyboard emulator
vk := keyboardemulator.NewKeyboardEmulator().SetAddRealLifeDelayBetweenPresses(true)
// Switch focus to the text document and select all its content
vk.Press(
// Switch focus
keyboardemulator.Keys{
keyboardemulator.KeyAlt,
keyboardemulator.KeyTab,
},
// Select all
keyboardemulator.Keys{
keyboardemulator.KeyControl,
keyboardemulator.KeyA,
},
)
// Write
vk.Write("go-keyboardemulator is awesome!")