Task

Get the current location of the mouse cursor relative to the active window.

Please specify if the window may be externally created.




1.upto(5) {
    Thread.sleep(1000)
    def p = java.awt.MouseInfo.pointerInfo.location
    println "${it}: x=${p.@x} y=${p.@y}"
}