Task

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

Please specify if the window may be externally created.




import Nanoquery.Util.Windows
 
// a function to handle the mouse moved event
def mouse_moved($caller, $e)
	println "(" + $e.getX() + ", " + $e.getY() + ")"
end
 
// create a window, set the handler for mouse moved, and show it
w = new("Window")
w.setSize(500, 500)
w.setHandler(w.mouseMoved, mouse_moved)
w.show()