gohook/example/main.go

41 lines
399 B
Go
Raw Normal View History

2019-02-19 23:32:48 +08:00
package main
import (
"fmt"
"github.com/robotn/gohook"
)
func add() {
s := hook.Start()
defer hook.End()
ct := false
for {
i := <-s
if i.Kind == hook.KeyHold && i.Rawcode == 59 {
ct = true
}
if ct && i.Rawcode == 12 {
break
}
}
}
func base() {
EvChan := hook.Start()
defer hook.End()
for ev := range EvChan {
fmt.Println(ev)
}
}
func main() {
base()
add()
}