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

Key down for Arrow Down is never invoked. #26

Open
takuyahara opened this issue Oct 29, 2020 · 3 comments
Open

Key down for Arrow Down is never invoked. #26

takuyahara opened this issue Oct 29, 2020 · 3 comments

Comments

@takuyahara
Copy link

As titled. Rawcode: 125 is Arrow Down and the others are other arrows.

  • go version go1.15.2 darwin/amd64
  • macOS 10.15.7 (19H2)
  • MacBook Pro (Retina, 15-inch, Mid 2015)
  • Built-in keyboard
$ go run example/main.go 
--- Please press ctrl + shift + q to stop hook ---
--- Please press w---
ctrl-shift-q
hook start...
hook:  2020-10-29 18:21:20.502464 +0900 JST m=+4.514493252 - Event: {Kind: HookEnabled}
hook:  2020-10-29 18:21:20.502482 +0900 JST m=+4.514510837 - Event: {Kind: KeyUp, Rawcode: 12, Keychar: 65535}
hook:  2020-10-29 18:21:20.610329 +0900 JST m=+4.622362170 - Event: {Kind: KeyUp, Rawcode: 59, Keychar: 65535}
hook:  2020-10-29 18:21:20.610347 +0900 JST m=+4.622380580 - Event: {Kind: KeyUp, Rawcode: 56, Keychar: 65535}
^[[Chook:  2020-10-29 18:21:25.652731 +0900 JST m=+9.664954525 - Event: {Kind: KeyDown, Rawcode: 124, Keychar: 29}
hook:  2020-10-29 18:21:25.652745 +0900 JST m=+9.664968877 - Event: {Kind: KeyHold, Rawcode: 124, Keychar: 65535}
hook:  2020-10-29 18:21:25.708012 +0900 JST m=+9.720237562 - Event: {Kind: KeyUp, Rawcode: 124, Keychar: 65535}
^[[Dhook:  2020-10-29 18:21:28.888841 +0900 JST m=+12.901185835 - Event: {Kind: KeyHold, Rawcode: 123, Keychar: 65535}
hook:  2020-10-29 18:21:28.888842 +0900 JST m=+12.901187556 - Event: {Kind: KeyDown, Rawcode: 123, Keychar: 28}
hook:  2020-10-29 18:21:28.997212 +0900 JST m=+13.009561845 - Event: {Kind: KeyUp, Rawcode: 123, Keychar: 65535}
^[[Ahook:  2020-10-29 18:21:37.633044 +0900 JST m=+21.645718726 - Event: {Kind: KeyHold, Rawcode: 126, Keychar: 65535}
hook:  2020-10-29 18:21:37.633055 +0900 JST m=+21.645729381 - Event: {Kind: KeyDown, Rawcode: 126, Keychar: 30}
hook:  2020-10-29 18:21:37.687625 +0900 JST m=+21.700301346 - Event: {Kind: KeyUp, Rawcode: 126, Keychar: 65535}
^[[Bhook:  2020-10-29 18:21:40.913595 +0900 JST m=+24.926393683 - Event: {Kind: KeyHold, Rawcode: 125, Keychar: 65535}
hook:  2020-10-29 18:21:40.965137 +0900 JST m=+24.977936924 - Event: {Kind: KeyUp, Rawcode: 125, Keychar: 65535}
hook:  2020-10-29 18:21:46.670449 +0900 JST m=+30.683463769 - Event: {Kind: KeyHold, Rawcode: 125, Keychar: 65535}
^[[Bhook:  2020-10-29 18:21:46.775177 +0900 JST m=+30.788196695 - Event: {Kind: KeyUp, Rawcode: 125, Keychar: 65535}
^[[Bhook:  2020-10-29 18:21:50.221418 +0900 JST m=+34.234566667 - Event: {Kind: KeyHold, Rawcode: 125, Keychar: 65535}
@vs-123
Copy link

vs-123 commented Oct 30, 2020

I don't think arrow keys are supported because they don't work for me.
Try using this code and pressing arrow keys to see if they respond:

package main
import (
  "fmt"
  hook "github.com/robotn/gohook"
)

func main() {

  fmt.Println("Press any key")

  hook.Register(hook.KeyDown, []string{}, func(e hook.Event) {

    fmt.Println(e)

  })

  s := hook.Start()

  <-hook.Process(s)
}

@takuyahara
Copy link
Author

Only arrow down key doesn't respond.

@vs-123
Copy link

vs-123 commented Oct 31, 2020

Maybe try changing the keyboard if possible to see if it works.

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

2 participants