image

LEARNING SCRATCH (OR any other language, for that matter) is all about discovering and finding out new things. In the real world, you use your five senses to find out new things. In the Scratch world, you use a category of blocks called the sensing blocks.

In this adventure, you see how to use the sensing blocks to detect things such as typing on the keyboard, mouse movements, and more!

Learning the Sensing Blocks

The Sensing Block Pallet contains 20 blocks, as shown in Figure 4-1. These blocks are colored light blue. There are 4 stack blocks, 5 Boolean blocks, and 11 reporter blocks.

image

Figure 4-1 The sensing blocks

Sensing blocks can be used for a number of different things. They can be used to keep track of how long things take within your program. They can be used to ask questions and then store the answers to be used within other blocks, and they can also be used to detect whether a key has been pressed on your keyboard or if there’s been movement of your mouse.

You can also use Sensing blocks to detect ...

Get Adventures in Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.