From 4f8581a884f793695a66a034d880b285138acc16 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Wed, 2 Dec 2020 13:01:20 -0400 Subject: [PATCH] update godoc and example --- examples/main.go | 6 +++--- hook.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/main.go b/examples/main.go index 367cf0a..bbe68f7 100644 --- a/examples/main.go +++ b/examples/main.go @@ -6,14 +6,14 @@ import ( hook "github.com/robotn/gohook" ) -func addEvent() { +func registerEvent() { fmt.Println("--- Please press ctrl + shift + q to stop hook ---") hook.Register(hook.KeyDown, []string{"q", "ctrl", "shift"}, func(e hook.Event) { fmt.Println("ctrl-shift-q") hook.End() }) - fmt.Println("--- Please press w---") + fmt.Println("--- Please press w ---") hook.Register(hook.KeyDown, []string{"w"}, func(e hook.Event) { fmt.Println("w-") }) @@ -54,7 +54,7 @@ func base() { } func main() { - addEvent() + registerEvent() base() diff --git a/hook.go b/hook.go index 420afa1..7fa2134 100644 --- a/hook.go +++ b/hook.go @@ -156,7 +156,7 @@ func Process(evChan <-chan Event) (out chan bool) { return } -// String return hook kind string +// String return formatted hook kind string func (e Event) String() string { switch e.Kind { case HookEnabled: @@ -202,7 +202,7 @@ func (e Event) String() string { return fmt.Sprintf("%v - Event: {Kind: FakeEvent}", e.When) } - return "Unknown event, contact the mantainers" + return "Unknown event, contact the mantainers." } // RawcodetoKeychar rawcode to keychar