Index Ai Academy
Glossary · Phase 7 · Software engineering

Event handler

Also written: event handlers

A function you give a program to call when something happens, such as a key press or a timer going off.

Try it now

Keys and the timer only change state. The picture is redrawn from that state every tick.

Learn it properly

Project: Pack Train, an arcade game · A grid game on the turtle canvas: game state as classes, a timer loop, key handlers and a saved best score. About 45 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write