Almost every computer-based experiment in psychology and cognitive neuroscience requires participants to respond in one way or another. The most common instrument to collect these responses is the computer keyboard. In the following sections, you will learn how to collect and process key presses.

Are peripherals accurate enough?

Some researchers claim that keyboards are too slow for their purposes, as they require ‘millisecond accuracy’. Because it is important to know your tools, this chapter will investigate this claim.

In most operating systems, peripherals (keyboards, mice, joysticks, game controllers, etc.) are polled at a certain rate. Polling a device means checking its state: are any of the keys ...

Get Python for Experimental Psychologists now with O’Reilly online learning.

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