Is there a simple way to get the mouse events, like when the left button is clicked, and when it is released in Go
?
And also is it possible to get that information even is the mouse is not hover the window's program ?
I'd like to draw a square over the screen, between the beginning and the release of the click, to capture that part of the screen.
Thank you
Try with robotgo - Golang Desktop Automation
import (
"fmt"
"github.com/go-vgo/robotgo"
)
func main() {
// mouse events: mleft, mright, wheelDown, wheelUp, wheelLeft, wheelRight.
mleft := robotgo.AddEvent("mleft")
if mleft == 0 {
fmt.Println("you press... ", "mouse left button")
}
}