Open ZeronoFreya opened 1 year ago
package main import ( "fmt" hook "github.com/robotn/gohook" ) func main() { // out: alt-q hook.Register(hook.KeyDown, []string{"alt", "q"}, func(e hook.Event) { fmt.Println("alt-q") }) // out: no output hook.Register(hook.KeyDown, []string{"up"}, func(e hook.Event) { fmt.Println("up") }) // out: no output hook.Register(hook.KeyHold, []string{"left"}, func(e hook.Event) { fmt.Println("left") }) // out: no output hook.Register(hook.KeyUp, []string{"down"}, func(e hook.Event) { fmt.Println("down") }) s := hook.Start() <-hook.Process(s) }
I'm sure there is nothing wrong with the keyboard, the following code prints out the keys normally
hook.Register(hook.KeyUp, []string{}, func(e hook.Event) { fmt.Println(e) })
...
Description
I'm sure there is nothing wrong with the keyboard, the following code prints out the keys normally
...