-
Introduction
-
Introducing Scratch
- Scratch Ideas
-
Activities Overview
- Scratch Activities Project
-
Algorithms and Programs
-
Write an Algorithm
-
- Sequences
- Loops
- Data: Variables
- User Input
- Conditionals
- Conclusion
What is User Input?
What is User Input?
User input is a term that means that the person using the program (the user) interacts with the program, usually by (but not always) using a keyboard/mouse.
For example, you might register for an event (for example: a workshop) using an online form. The user input in this example would be the details you would enter into the form (such as your name and email address).
Another example of user input is controlling a character in a videogame with a joystick. The videogame would have some Code that would take that input from the joystick (for example: moving the joystick to the right) and then perform some action (in this example: moving the character to the right).
In Scratch, there a few different ways to get user input. Examples of user input in Scratch include:
- Detecting when a user has pressed a key, with the when key pressed block in the Events section and if key pressed? block in the Sensing section.
- Asking the user a question with the ask and wait block in the Sensing section.
- Detecting when a user has clicked on a sprite (for example: when a user clicks on the Cat) with the when this sprite clicked block.
In this activity we will focus on the first two examples: using the when key pressed block and asking the user a question.
Views | |
---|---|
1 | Total Views |
1 | Members Views |
0 | Public Views |
Share by mail
Please login to share this webpage by email.