From d5e965f25c63a7f083c9bfc9dd8d756a88e6ffb5 Mon Sep 17 00:00:00 2001 From: caue Date: Sat, 28 Mar 2020 21:48:51 -0300 Subject: [PATCH] actually for real new stuff --- README.md | 14 +++++++++++--- hook.go | 2 -- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 80c632b..b40657f 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,16 @@ import ( func main() { EvChan := hook.Start() defer hook.End() - for ev := range EvChan { - fmt.Println(ev) - } + // drawing := false + + hook.Register(hook.KeyDown, []string{"alt", "p"}, func(e hook.Event) { + fmt.Println("alt-p ", e) + }) + + hook.Register(hook.KeyDown, []string{}, func(e hook.Event) { + fmt.Println(e.Keycode) + }) + + <-hook.Process(EvChan) } ``` \ No newline at end of file diff --git a/hook.go b/hook.go index 41274b7..6d592f4 100644 --- a/hook.go +++ b/hook.go @@ -28,8 +28,6 @@ import ( "fmt" "time" "unsafe" - - hook "github.com/robotn/gohook" ) const (