robotn / gohook

GoHook, Go global keyboard and mouse listener hook
MIT License
324 stars 43 forks source link

How do I register function keys? #25

Closed vs-123 closed 3 years ago

vs-123 commented 4 years ago

Hi, I tried to register F6 by using this code

fmt.Println("Press F6")
hook.Register(hook.KeyDown, []string{"f6"}, func(e hook.Event) {
        fmt.Println("F6 was pressed")
})
s := hook.Start()
<-hook.Process(s)

but it doesn't seem to work.

My question is, how do I register function keys? Thank you in advance.

cauefcr commented 4 years ago

i've found no realiable way to do that yet.

feel free to PR.