Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Simulate-input-Keyboard/Go/simulate-input-keyboard.go
Normal file
29
Task/Simulate-input-Keyboard/Go/simulate-input-keyboard.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/micmonay/keybd_event"
|
||||
"log"
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
kb, err := keybd_event.NewKeyBonding()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// For linux, need to wait 2 seconds
|
||||
if runtime.GOOS == "linux" {
|
||||
time.Sleep(2 * time.Second)
|
||||
}
|
||||
|
||||
//set keys
|
||||
kb.SetKeys(keybd_event.VK_D, keybd_event.VK_I, keybd_event.VK_R, keybd_event.VK_ENTER)
|
||||
|
||||
//launch
|
||||
err = kb.Launching()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue