October 2019
Beginner to intermediate
498 pages
14h 13m
English
The turtle module provides three methods to register callbacks for key, mouse, and timer events:
▶ onkey
▶ onclick
▶ ontimer
In addition, the listen method is used to give the turtle canvas focus so that the event handler can respond to key presses. Each method has conventions for the parameters it accepts. TABLE 13.3 explains each of these methods to register callbacks for events, as well as the listen method.
TABLE 13.3 Turtle Methods to Register Callbacks |
|
|---|---|
Method |
Description |
|
Bind a function to a key press so that |
Read now
Unlock full access