Open
Description
For the hotkey monitoring implementation I want to use goroutine+AddEvents/AddEvent
Example code:
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
"time"
)
func main() {
go addKeysListen("q", "ctrl")
go addKeyListen("k")
for {
// do something
time.Sleep(time.Millisecond * 50)
}
}
func addKeysListen(key string, arr ...string) {
for {
if ok := robotgo.AddEvents(key, arr...); ok {
fmt.Println("pressed Ctrl + q")
}
}
}
func addKeyListen(key string) {
for {
if ok := robotgo.AddEvent(key); ok {
fmt.Println("Pressed k")
}
}
}
If I only listen to a hotkey, it is ok, but more than one will fail.
Can you change the underlying code to support this type of writing? Or has a more elegant solution?