gohook/test/main.go
htmk e5d15765a1 Part 1 of supporting async events
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?
2019-02-08 14:39:24 -02:00

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...")
}
}