From the course: Computer Science Principles: Programming

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Capture input from the user

Capture input from the user

- It is entirely possible to create programs that run on their own with no input from users, but most programs require a user to provide some input, even if it's a simple tap. Capturing input from users can come in many forms, but it generally requires two things. The first is that the app needs to be listening for the user. It needs to know to be on the lookout for the user to do something. It's like shouting in the woods, if no one is there to listen, what you say isn't communicated. With user events like providing input, the same has to happen. User interaction can take many forms. A keyboard is used to enter text and numbers into a program to create new data that is managed by the program. Certain keys or key combinations can initiate certain functions in a program. A mouse is used to point and select items in a graphical user interface. Mouse gestures such as dragging and dropping manipulate objects on the screen. In addition, the path of the mouse can be used to draw and perform…

Contents