Computing · Stage 4

Events: When This, Do That

Coding & Systems · events · a click or a key press tells a program when to start

✦ Computing📘 Stage 4 · S4⏱ ~11 min🧒 Ages 8–9★ Free to start
I can use an event like when-clicked or when-key-pressed to start my program
Kavi the owl for Computing
📖

Kavi's Cat Won't Move

Kavi snapped together some blocks — move 10 steps, turn around, say hi — but when the program opened, the cat just sat there. "Why won't it go?" Kavi hooted. Then Kavi noticed: nothing told the blocks when to start! So Kavi added a block on top: when 🏳️ clicked. Now a click on the green flag made the whole program run. "That top block is an event," said Kavi. "An event — a click or a key press — tells my program when to begin!"

🎓

What your child will learn

1An event tells a program WHEN to startAn event is something that happens — a click or a key press — that starts your program. The event block sits on top, so the steps below it know when to run. Tap each event to hear its job.
2No event, or an event on top?A pile of blocks with no event has no way to start — the computer does not know WHEN to run them. Put an event on top and a click or key press sets the whole program going.
3Click the flag — the program runsThe event block is on top. The steps under it wait until the event happens. Press ▶ Run to pretend you clicked the green flag, and watch the program start.
4Why won't this program start?Kavi made three blocks — move, spin, say hi — but when the program opens, nothing happens. Think about what tells a program WHEN to go, then reveal.
🔍

A peek inside

Kavi wants the cat to jump when the Space key is pressed. Which event block starts it?
a key press is a key-press event

Try this at home: A click or a key press that tells a program when to start is called an ____.

Ready to play and learn?

Start the free interactive lesson, or print the handout for screen-free play.

Part of Computing · Stage 4 · S4 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.