robotn / gohook

GoHook, Go global keyboard and mouse listener hook
MIT License
314 stars 44 forks source link

how to get mouse double click in desktop #8

Closed ddatsh closed 6 months ago

ddatsh commented 4 years ago

as title

vcaesar commented 4 years ago

Listen twice.

ddatsh commented 4 years ago

Listen twice.

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

AutomateAaron commented 4 years ago

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)