robotn / gohook

GoHook, Go global keyboard and mouse listener hook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to get mouse double click in desktop

ddatsh opened this issue · comments

as title

commented

Listen twice.

Listen twice.

bad, title
I want to know ,click in desktop area, not in applications

The hook.Event type has an attribute Clicks which may be what you're looking for 😉

For example:

robotgo.EventHook(hook.MouseDown, []string{}, func(e hook.Event) {
	if e.Button == hook.MouseMap["right"] {
		fmt.Printf("right @  clicks: %v\n", e.Clicks)
	}
})
s := robotgo.EventStart()
<-robotgo.EventProcess(s)