asticode / go-keyboardemulator

Cross-OS keyboard emulator that can take control of your keyboard through code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Important

go-keyboardemulator is only available for Windows for now. Linux will come next and hopefully MAC OSX too :D

About

godoc

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).

Install go-keyboardemulator

Run the following command:

$ go get github.com/asticode/go-keyboardemulator/keyboardemulator

Example

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!")

About

Cross-OS keyboard emulator that can take control of your keyboard through code

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%