robotn/gohook

when i press key q ,will perform two

hlj2722 opened this issue · 0 comments

when i press q, will print
press q
ctrl-q

`package main

import (
"fmt"

"github.com/MakeNowJust/hotkey"
hook "github.com/robotn/gohook"

)

func main() {
hook.Register(hook.KeyUp, nil, func(e hook.Event) {
if hook.RawcodetoKeychar(uint16(e.Rawcode)) == "q" {
fmt.Println("press q")
}
})
hook.Register(hook.KeyUp, []string{"q"}, func(e hook.Event) {
fmt.Println("q")
})
hook.Register(hook.KeyDown, []string{"q", "ctrl"}, func(e hook.Event) {
fmt.Println("ctrl-q")
})

s := hook.Start()
<-hook.Process(s)

}`

1666604372812