What is an Event? Think about a doorbell. Most of the time, nothing happens. The doorbell just sits there, waiting. Then someone presses the button — and the bell rings. What happened? Something occurred . Someone pressed the button. That act of pressing — that is an event . The event caused a response: the bell rang. The Simple Pattern Every event follows the same pattern: Something happens → A response is triggered What Happened (Event) What Happened Next (Response) --- --- Someone pressed the doorbell The bell rang inside the house A smoke alarm detected smoke The alarm started making noise The alarm clock reached 7:00 AM It started buzzing You tapped play on Spotify The song started playing Someone sent you a message Your phone vibrated In every case: something happened first, and then something else happened because of it . The first thing is the event. The second thing is the response. What Makes Something an Event? An event is: 1. Something that happens — it did not exist before, and now it does 2. Something a program can notice — the computer has to be watching for it 3. Something that triggers a response — when the event occurs, specific commands run Events can come from many places: You — a tap, a click, a keypress, a swipe, a voice command Time — the clock reaching a certain time, a timer running out Sensors — a motion sensor detecting movement, a temperature sensor reading too high Other programs — a message arriving, a file finishing download, a payment being completed Events vs Commands: What Is the Difference? You learned in the Commands series that commands are things you tell a computer to do. Events are different — they are things that happen to the computer (or the device), from inside or outside. Command Event --- --- --- Who starts it You, actively Something that occurs (you, time, sensor, another system) Example "Play this song" "Someone tapped the play button" What it does Directly triggers an action Triggers a listening program to run its commands A command is an instruction you write. An event is a thing that happens that the program detects. The Doorbell, Revisited Let us trace a doorbell event carefully: 1. The event occurs: someone presses the button outside 2. The program notices it: the doorbell circuit is always listening for a button press 3. The response runs: electricity flows to the bell mechanism, which vibrates and makes a sound 4. The event is over: the doorbell returns to waiting Step 2 — the program is always listening — is important. The doorbell does not ring when no one presses the button, even though the wiring is connected. It is waiting. Listening. Ready to respond the moment the event occurs. This idea of a program waiting and watching for a specific event is called an event listener . It is one of the most important concepts in programming. Without Events, Programs Are Stuck Imagine a music app with no events. The app opens — and then what? Nothing happens. There is nobody pressing play, nobody selecting a song, nobody turning up the volume. Events are what make interactive systems interactive . They are how programs know when to do something — because something just happened. In the next post, we will look at just how many events are happening around you all the time, in devices you use every day. 🎯 Try This Yourself The Secret Trigger Game You are going to turn yourself into an event listener. You need one other person and a scrap of paper. 1. Write three rules on the paper, each in the form "When happens → I will " . For example: when someone claps → I stand up ; when someone says the word "banana" → I clap twice ; when the clock reaches the next whole minute → I say "ding" . 2. Hand the paper to your partner so they know exactly what your triggers are. 3. Now go and do something completely different — read, draw, tidy your bag. Do not sit and wait. 4. Your partner now tries to set you off. They should also try to trick you with near-misses: a cough instead of a clap, the word "bandana" instead of "banana". 5. Swap over and let them be the listener. What to watch for: you carried on with your own thing and still reacted the moment a real trigger arrived. That is what listening means — waiting costs you nothing, and the response only runs when the event actually happens. The near-misses matter too: "bandana" is not "banana", and a program that is not told exactly what to listen for will either miss real events or fire on the wrong ones. 🤔 Check Yourself 1. What is the difference between an event and a response? The event is the thing that happens — the button being pressed. The response is what runs because of it — the bell ringing. The event comes first and causes the response. One doorbell press can even cause several responses: the bell rings, a light flashes, a camera starts recording. 2. A doorbell is wired up and working, but nobody has pressed it all day. Is the program broken? No — it is listening . A listener that has not fired looks exactly like…