Guide to OpenSesame
OpenSesame is an open-source software package for building and running psychology experiments. It's written in Python and is available for Windows, OS X, and Linux systems.
Using a button box with OpenSesame
The File:SRBoxexample.opensesame.tar.gz provides a demonstration of how to collect button presses in an OpenSesame experiment.
In this example the basic pattern of presenting a stimulus and waiting for a response proceeds in three steps. Take a look at the experiment overview:
First, text is displayed to the subject by the 'intro' text display item. By default items of this type wait for a keypress, but we change the default 'keypress' value of the 'Duration' property to '0' to cause the script to immediately execute the following item.
The next item is the intro_response srbox item, which is the interface to the button box. The script will wait here until one of the buttons identified by the 'Allowed responses' property is pressed. In this case only button 3 (the middle button) is allowed. The semicolon-separated list '1;3;5' in the 'Turn on lights' property indicates that button lights 1, 3, and 5 will illuminate. The 'Allowed responses' property can also contain a semicolon-separated list.
The 'autodetect' value of the 'Device name' property identifies that OpenSesame should attempt to find the button box automatically.
The 'infinite' value of the 'Timeout' property means that the script will wait on this item until one of the allowed responses is received. During our script the intro text display therefore remains on the screen until an allowed response is received.