11 Mouse and Keyboard Interaction

In this chapter, you’ll learn how to program interactive sketches that respond to mouse and keyboard input. You can combine those input devices in interesting and useful ways. For example, many computer games use a combination of keys for player movement and the mouse for aiming. Here, you’ll program sketches that use the mouse to paint as well as to select items from a tool palette. You’ll also add shortcut keys to activate tools by using the keyboard.

This chapter introduces system variables you can use to monitor mouse clicks and keypresses. You’ll also learn about event functions that execute whenever ...

Get Learn Python Visually now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.