From 5dd3b6cd6601092e4de84466cd63c2c408eff206 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Wed, 27 May 2020 11:01:59 -0400 Subject: [PATCH] Update README.md and CHANGELOG.md --- README.md | 14 ++++++++++++++ README_zh.md | 14 ++++++++++++++ docs/CHANGELOG.md | 8 +++++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cab6b1e..22d9818 100644 --- a/README.md +++ b/README.md @@ -229,6 +229,20 @@ import ( ) func main() { + fmt.Println("--- Please press ctrl + shift + q to stop hook ---") + robotgo.EventHook(hook.KeyDown, []string{"q", "ctrl", "shift"}, func(e hook.Event) { + fmt.Println("ctrl-shift-q") + robotgo.EventEnd() + }) + + fmt.Println("--- Please press w---") + robotgo.EventHook(hook.KeyDown, []string{"w"}, func(e hook.Event) { + fmt.Println("w") + }) + + s := robotgo.EventStart() + <-robotgo.EventProcess(s) + ok := robotgo.AddEvents("q", "ctrl", "shift") if ok { fmt.Println("add events...") diff --git a/README_zh.md b/README_zh.md index 6ff8a56..ccf0f3b 100644 --- a/README_zh.md +++ b/README_zh.md @@ -226,6 +226,20 @@ import ( ) func main() { + fmt.Println("--- Please press ctrl + shift + q to stop hook ---") + robotgo.EventHook(hook.KeyDown, []string{"q", "ctrl", "shift"}, func(e hook.Event) { + fmt.Println("ctrl-shift-q") + robotgo.EventEnd() + }) + + fmt.Println("--- Please press w---") + robotgo.EventHook(hook.KeyDown, []string{"w"}, func(e hook.Event) { + fmt.Println("w") + }) + + s := robotgo.EventStart() + <-robotgo.EventProcess(s) + ok := robotgo.AddEvents("q", "ctrl", "shift") if ok { fmt.Println("add events...") diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 68cd4cb..d7f4d4c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,7 +9,7 @@ add gohook modern and concurrent API add new gohook examples, thks for cauefcr -Support for multiple screens +Support for multiple screens add getMousePos() multiple screens support add move smooth multiple screens support @@ -22,6 +22,8 @@ add int32_t types support update keycode type use uint16 with gohook, not type convert add ToBitmapBytes func (#204) +gohook: sched_yield support for non-POSIX windows gcc + add gops test code support add Process() function test code add more gops test code @@ -294,7 +296,7 @@ update gops and other mod files fixed bug # Sierra Nevada -### Add +### Add - [NEW] Add asynchronous event support - [NEW] Add multiple keypress event listener support @@ -333,7 +335,7 @@ update gops and other mod files fixed bug - [FIX] Add AddEvents func, Fixed #98, #61, #69... - [FIX] Add asynchronous event support, Fixed #196, #89... -- [FIX] add AddMouse func, Fixed #138 +- [FIX] add AddMouse func, Fixed #138 - [FIX] Update _Ctype_char to C.char, Fixed go1.12 build error #191 - [FIX] Update hook, Fixed #195 warning and json break bug - [FIX] Fixed color picker, Update README.md and docs