Closed buYoung closed 4 years ago
You could use a boolean, when tab is pressed set it to true, when tab is let go set it to false, and use that boolean for your interest.
You could also check out my fork of gohook to see if it's interface suits you better. https://github.com/cauefcr/ghook
Can give me a PR? Thx.
Even if it's not backwards compatible?
On Fri, Apr 17, 2020, 12:17 PM vz notifications@github.com wrote:
Can give me a PR? Thx.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/robotn/gohook/issues/9#issuecomment-615302801, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACY42HJYONM6DNPC65XMNKLRNBXHTANCNFSM4MJHBU2A .
Oh, I was mistaken. While I was pressing the TAB key, I thought that the HOLD and DOWN were continuously output, and the UP was also output.
EXAPLE) s := hook.Start() defer hook.End() d := false for { select { case i := <-s: if i.Rawcode == 9 { switch i.Kind { case 3,4: d = true case 5: d= false } } } println(d) }
s := hook.Start() defer hook.End() for { select { case i:= <- s : fmt.Printf("%s \n", i) }
I wrote it like the above code and proceeded with the test. The only result I want is HOLD or DOWN while I'm pressing TAB, But I've seen that UP/DOWN//HOLD is constantly output.
How do I solve this problem?