mirror of
https://github.com/robotn/gohook.git
synced 2025-04-28 06:28:15 +08:00
changed go.mod to reflect the change
This commit is contained in:
parent
35fdcff3ec
commit
3186c43ae7
10
test/main.go
10
test/main.go
@ -4,13 +4,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cauefcr/gohook"
|
"github.com/cauefcr/ghook"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
s := hook.Start()
|
s := hook.Start()
|
||||||
defer hook.End()
|
defer hook.End()
|
||||||
tout := time.After(time.Hour*2)
|
tout := time.After(time.Hour * 2)
|
||||||
done := false
|
done := false
|
||||||
for !done {
|
for !done {
|
||||||
select {
|
select {
|
||||||
@ -19,13 +19,13 @@ func main() {
|
|||||||
if i.Keychar == 'q' {
|
if i.Keychar == 'q' {
|
||||||
tout = time.After(0)
|
tout = time.After(0)
|
||||||
}
|
}
|
||||||
fmt.Printf("%v key: %c:%v\n",i.Kind, i.Keychar,i.Rawcode)
|
fmt.Printf("%v key: %c:%v\n", i.Kind, i.Keychar, i.Rawcode)
|
||||||
} else if i.Kind >= hook.MouseDown && i.Kind < hook.MouseWheel {
|
} else if i.Kind >= hook.MouseDown && i.Kind < hook.MouseWheel {
|
||||||
//fmt.Printf("x: %v, y: %v, button: %v\n", i.X, i.Y, i.Button)
|
//fmt.Printf("x: %v, y: %v, button: %v\n", i.X, i.Y, i.Button)
|
||||||
}else if i.Kind == hook.MouseWheel {
|
} else if i.Kind == hook.MouseWheel {
|
||||||
//fmt.Printf("x: %v, y: %v, button: %v, wheel: %v, rotation: %v\n", i.X, i.Y, i.Button,i.Amount,i.Rotation)
|
//fmt.Printf("x: %v, y: %v, button: %v, wheel: %v, rotation: %v\n", i.X, i.Y, i.Button,i.Amount,i.Rotation)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%+v\n",i)
|
fmt.Printf("%+v\n", i)
|
||||||
}
|
}
|
||||||
case <-tout:
|
case <-tout:
|
||||||
fmt.Print("Done.")
|
fmt.Print("Done.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user