Home›Lesson Plans›Computer Science›Computer Science · Grade 4

Events in Code

Fourth graders learn about events — things that happen (like a click, a key press, or a collision) that a program can respond to — the way code becomes interactive and reacts to the user.

Grade 4Programming40 minutes1 class periodUse → Modify → CreateExplicit teaching4 StandardsCSTA
Start the Lesson
Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Define an event.
  • ✓Match events to responses.
  • ✓See how events make programs interactive.
  • ✓Use events in code.
Essential Question

How does a game know to move your character when you press a key, or score a point when things bump? It responds to EVENTS. What is an event in code?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Match It · Interactive

Match the Event to Its Response

Project this and match each event to what happens in response — tap an event, then tap the response.

⚡ Match each event to its responseTry it
Event (what happens)
Response (what the program does)
Now tap the response!
The Lesson · Use → Modify → Create (a coding progression with Unplugged practice)

40 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — React to Me

5 min

A game reacts when you press a key — how? It responds to events.

👩‍🏫 Teacher Moves

  • Show an interactive game.
  • Ask how it reacts.
  • Set the goal.

🎒 Student Actions

  • Watch.
  • Wonder.
  • Predict.
2

Unplugged — Unplug It

9 min

Students practice.

👩‍🏫 Teacher Moves

  • Play “when I clap, you jump.”
  • Name the event and response.
  • Feel the idea.

🎒 Student Actions

  • Play it.
  • Name them.
  • Feel it.
3

Use — Match Events

11 min

Students use.

👩‍🏫 Teacher Moves

  • Send students to Match the Event.
  • Match each one.
  • Explain them.

🎒 Student Actions

  • Match.
  • Explain.
  • Check.
4

Modify — Change It

10 min

Students modify.

👩‍🏫 Teacher Moves

  • Change what an event does.
  • Predict the result.
  • Explain the change.

🎒 Student Actions

  • Change it.
  • Predict.
  • Explain.
5

Create — Create

5 min

Students conclude.

👩‍🏫 Teacher Moves

  • Design an event-response.
  • Explain interactivity.
  • Complete the exit ticket.

🎒 Student Actions

  • Design it.
  • Explain it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and ISTE Standards for Students.

CSTA
1B-AP-09

Create programs that use events to control the flow.

CSTA
1B-AP-10

Create programs with sequence and events.

CSTA
1B-AP-11

Decompose problems into events.

ISTE
5

Computational Thinker.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Event + response cards.
  • Sentence frame: “When ___, then ___.”
  • Act out events.

Support & Access

IEP / 504
  • Start with click → action.
  • Match one pair at a time.
  • Act it out.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add multiple events.
  • Code an event in a game.
  • Explain event handlers.
Materials

What to gather

  • 📽️Projector / board
  • ⚡Event cards
  • 💻Match the Event to Its Response
  • 💻Coding tool (optional)
  • ✏️Pencils
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

eventsomething that happens a program can respond toresponsewhat the program does after an eventclickpressing a mouse or buttonkey presspushing a keyinteractiveresponds to the usertriggerwhat starts an eventinputinformation from the usercollisionwhen two things touch
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What is an event in a program?
Something that happens — like a click or key press — that the program can respond to.
QUESTION 2
What might happen when you press an arrow key in a game?
A character moves in that direction.
QUESTION 3
Why are events important in code?
They make programs interactive — able to respond to the user.

Create: an event-response.

Have students write one “when ___, then ___” event-response rule for a game they imagine. A printable events sheet is in the Computer Science library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 EventsFlip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 EventsQuiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ EventsPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: click, collision, event, input, interactive, key press, response, trigger
  1. responds to the user
  2. when two things touch
  3. what starts an event
  4. information from the user
  5. what the program does after an event
  6. pushing a key
  7. something that happens a program can respond to
  8. pressing a mouse or button

Part B · Show what you learned

  1. What is an event in a program?
  2. What might happen when you press an arrow key in a game?
  3. Why are events important in code?
Answer key — Part A: 1) interactive · 2) collision · 3) trigger · 4) input · 5) response · 6) key press · 7) event · 8) click
Part B: 1) Something that happens — like a click or key press — that the program can respond to. 2) A character moves in that direction. 3) They make programs interactive — able to respond to the user.