Future careers in the AI era: what to prepare now

Coding Education

Bayu Nugraha
Children's Coding Specialist

In programming, an event is something that happens and triggers code to run — such as a mouse click, a key press, or a tap on the screen. Unlike the everyday meaning of "event" (an occasion or gathering), an event in coding is a signal that tells the program when to react. The program waits for an event to happen, then runs the instructions prepared to respond to it.
Table of Contents
Every event is linked to a block of code called an "event handler" — code that runs only when that event happens. The program keeps waiting; the moment the user does something, the event fires and the code runs at once. In Scratch this is easy to see: the "when green flag clicked" block runs everything below it as soon as the flag is pressed. There are also blocks like "when space key pressed" or "when this sprite clicked". In Python, an event might be input() waiting for the user to type. A real example: in a game, a character does not jump on its own — it jumps because a "space key pressed" event triggers the jump code. In fact, almost every app you use — from games to the "send" button in a chat app — works based on events.
Events are grouped by what triggers them. The most common kinds:
A style of coding where the whole flow is driven by events like these is called event-driven programming, and almost every modern app uses it. A child can build their first event-driven game in a free Algonova coding class.
Understanding events teaches kids to think in cause and effect: "if this happens, then do that." It is the foundation of building interactive programs that respond to the user, instead of just running by themselves. In the Algonova coding course, kids learn events through games they build themselves, and the concept is closely tied to what a variable is, which stores the result of each action.
Want your child to build their first game that reacts when a button is pressed? Try a free Algonova coding class.
An event is something that happens and triggers code to run, such as a mouse click or a key press. The program waits for the event, then runs the instructions prepared to respond to it.
The easiest example is the "when green flag clicked" block in Scratch. As soon as the flag is pressed, all the code below it runs right away — that is an event triggering an action.
In everyday language, an event means an occasion like a party or concert. In programming, an event means a technical action such as a click or key press that makes the code react.
Without events, a game cannot respond to the player. Events like "key pressed" or "sprite clicked" make a character move, jump, or shoot according to the player's actions.