turtle.onscreenclick()

turtle.onscreenclick(fun, btn=1, add=None)

Bind fun to mouse-click event on canvas.

Arguments: fun – a function with two arguments, the coordinates of the

clicked point on the canvas.

num – the number of the mouse-button, defaults to 1

Example (for a TurtleScreen instance named screen and a Turtle instance named turtle):

>>> onclick(goto)
>>> # Subsequently clicking into the TurtleScreen will
>>> # make the turtle move to the clicked point.
>>> onclick(None)