mirror of
https://github.com/robotn/gohook.git
synced 2025-01-18 21:56:40 +08:00
Update README.md
This commit is contained in:
parent
0fa5a96dfe
commit
a945300efa
@ -17,6 +17,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
add()
|
||||
|
||||
low()
|
||||
}
|
||||
|
||||
func add() {
|
||||
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")
|
||||
@ -30,7 +36,9 @@ func main() {
|
||||
|
||||
s := hook.Start()
|
||||
<-hook.Process(s)
|
||||
}
|
||||
|
||||
func low() {
|
||||
EvChan := hook.Start()
|
||||
defer hook.End()
|
||||
|
||||
@ -38,6 +46,7 @@ func main() {
|
||||
fmt.Println("hook: ", ev)
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Based on [libuiohook](https://github.com/kwhat/libuiohook).
|
Loading…
Reference in New Issue
Block a user