You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using example code from main page ubuntu 22.04/1 LTS
go version go1.21.1 linux/amd64
package main
import (
"runtime"
"time"
"github.com/micmonay/keybd_event"
)
func main() {
kb, err := keybd_event.NewKeyBonding()
if err != nil {
panic(err)
}
// For linux, it is very important to wait 2 seconds
if runtime.GOOS == "linux" {
time.Sleep(2 * time.Second)
}
// Select keys to be pressed
kb.SetKeys(keybd_event.VK_A, keybd_event.VK_B)
// Set shift to be pressed
kb.HasSHIFT(true)
// Press the selected keys
err = kb.Launching()
if err != nil {
panic(err)
}
// Or you can use Press and Release
kb.Press()
time.Sleep(10 * time.Millisecond)
kb.Release()
// Here, the program will generate "ABAB" as if they were pressed on the keyboard.
}
using example code from main page ubuntu 22.04/1 LTS
go version go1.21.1 linux/amd64
package main
import (
"runtime"
"time"
"github.com/micmonay/keybd_event"
)
func main() {
kb, err := keybd_event.NewKeyBonding()
if err != nil {
panic(err)
}
// For linux, it is very important to wait 2 seconds
if runtime.GOOS == "linux" {
time.Sleep(2 * time.Second)
}
// Select keys to be pressed
kb.SetKeys(keybd_event.VK_A, keybd_event.VK_B)
// Set shift to be pressed
kb.HasSHIFT(true)
// Press the selected keys
err = kb.Launching()
if err != nil {
panic(err)
}
// Or you can use Press and Release
kb.Press()
time.Sleep(10 * time.Millisecond)
kb.Release()
// Here, the program will generate "ABAB" as if they were pressed on the keyboard.
}
$ go build .
github.com/micmonay/keybd_event
../../go/pkg/mod/github.com/micmonay/[email protected]/keybd_event.go:20:9: undefined: initKeyBD
The text was updated successfully, but these errors were encountered: