O'Reilly logo

Adventures in Coding by Chris Minnick, Eva Holland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required