Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when i press key q ,will perform two #39

Open
hlj2722 opened this issue Oct 24, 2022 · 0 comments
Open

when i press key q ,will perform two #39

hlj2722 opened this issue Oct 24, 2022 · 0 comments

Comments

@hlj2722
Copy link

hlj2722 commented Oct 24, 2022

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

@hlj2722 hlj2722 changed the title when i press key q and ctrl + q ,will perform two when i press key q ,will perform two Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant