7. Sensing
Sensing code blocks allow your program, sprites and objects to sense the stage.
7.1. Touching
![_images/00-touching-mouse-pointer.png](_images/00-touching-mouse-pointer.png)
This code block detects when something is touching the mouse pointer.
![_images/00-touching-edge.png](_images/00-touching-edge.png)
This code block detects when something is touching the edge.
![_images/01-touching-color.png](_images/01-touching-color.png)
This code block detects when something is touching a specified color.
![_images/02-color-x-touching-color-y.png](_images/02-color-x-touching-color-y.png)
This code block detects when two specified colors are touching.
7.2. Distance
![_images/03-distance-to-mouse-pointer.png](_images/03-distance-to-mouse-pointer.png)
This code block detects the distance to the specified object (for example, mouse pointer
).
7.3. Asking
You may get input from users.
![_images/04-ask-name-wait.png](_images/04-ask-name-wait.png)
This code block asks the user for input.
7.4. Keys
![_images/05-key-space-pressed.png](_images/05-key-space-pressed.png)
This code block senses when the space bar
is pressed.
![_images/06-key-up-pressed.png](_images/06-key-up-pressed.png)
This code block senses when the up arrow
is pressed.
![_images/07-key-down-pressed.png](_images/07-key-down-pressed.png)
This code block senses when the down arrow
is pressed.
![_images/08-key-right-pressed.png](_images/08-key-right-pressed.png)
This code block senses when the right arrow
is pressed.
![_images/09-key-left-pressed.png](_images/09-key-left-pressed.png)
This code block senses when the left arrow
is pressed.
7.5. Mouse
![_images/10-mouse-down.png](_images/10-mouse-down.png)
This code block senses if the mouse is pressed down.
![_images/11-mouse-x.png](_images/11-mouse-x.png)
This code block senses the x
coordinate of the mouse.
![_images/12-mouse-y.png](_images/12-mouse-y.png)
This code block senses the y
coordinate of the mouse.
7.6. Drag
![_images/19-set-drag-mode.png](_images/19-set-drag-mode.png)
This code block sets the drag mode.
7.7. Timer
![_images/13-reset-timer.png](_images/13-reset-timer.png)
This code block resets the timer.
7.8. Stage
![_images/14-backdrop-number-stage.png](_images/14-backdrop-number-stage.png)
This code block senses the backdrop of the stage. For example, is it the first, second, third, and so on backdrop?
![_images/15-backdrop-name-stage.png](_images/15-backdrop-name-stage.png)
This code block senses the backdrop name of the stage.
![_images/16-volume-stage.png](_images/16-volume-stage.png)
This code block senses the volume of the stage.
![_images/17-my-variable-stage.png](_images/17-my-variable-stage.png)
This code block senses the specified variable of the stage.
7.9. Days
![_images/18-days-since-2000.png](_images/18-days-since-2000.png)
This code block senses the number of days since the year 2000
.