mirror of
https://github.com/robotn/gohook.git
synced 2025-04-28 16:18:25 +08:00
made the dispatch process send events via json through a channel (the c kind), made another function that receives it and sends it trough another channel (the go kind) todo: remove usage of function-local data trough channel todo:find error that is causing the c channel to fill up?
24 lines
272 B
Go
24 lines
272 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/robotn/gohook"
|
|
)
|
|
|
|
func main() {
|
|
s := hook.StartEvent()
|
|
|
|
go func() {
|
|
fmt.Print("woo!")
|
|
for i:=range s {
|
|
fmt.Println(i)
|
|
}
|
|
}()
|
|
// hook.AsyncHook()
|
|
veve := hook.AddEvent("v")
|
|
if veve == 0 {
|
|
fmt.Println("v...")
|
|
}
|
|
}
|