# when (space) key pressed — Scratch Block Guide > Triggers whenever the chosen keyboard key is pressed, even if the green flag was not clicked. How to use the "when (space) key pressed" block in Scratch 3.0 (Events Blocks): clear explanation, working block example, and debugging tips. ## What this block does Triggers whenever the chosen keyboard key is pressed, even if the green flag was not clicked. Good for single-tap actions like flipping slides, playing notes, or toggling a menu. - Category: Events Blocks - Key tip: For smooth walking in games, use "forever + if " instead—it has no OS key-repeat delay. ## Working Scratch example Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it. **Example using when (space) key pressed** - When (space) key pressed - Start sound (Pop) - Next costume Try it: Each tap of space plays a pop and switches costume. ## Related block guides Explore other blocks in the same category or return to the full English Block Dictionary. - [Back to Events Blocks](/en/dictionary/events/): See the overview and patterns for Events Blocks. - [Scratch Block Dictionary (All Categories)](/en/dictionary/): Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Updated: 2026-11-23 Author: [Takamasa Suzuki](https://scratch.gmnavi.jp/about/author/) Japanese Edition: https://scratch.gmnavi.jp/dictionary/events/key-pressed-event/ [Scratch Daizen (English)](https://scratch.gmnavi.jp/en/)