Tutorial: Setting Valid Keys (5/21)


…\DirectRT\samples\1 bare bones\validkeys.csv


In the previous samples, you have been able to hit any key and the session would continue. Often you will want to limit subjects to particular key presses.

Open the input file for this sample and see what's different from the last one. Notice that instead of RT:any, we now see RT:num,numpad indicated for the image trials. Try running this session and see what happens. When you see an image try to press any key other a number. Num allows the regular keyboard numbers and numpad allows those on the keyboard number pad (if it has one).

You set valid keys by separating them with commas after the RT:

All of the valid key codes can be accessed by clicking "Keycodes" from the main Help window, or by clicking on KeyCodes in the help menu of the main DirectRT program. Try this. For example, see that the code for the Z key is 44 and the code for the / key is 53. If you want to limit responses to either of those two keys, you would enter RT:44,53. Try changing the one of the values to RT:44,53 (or any other codes) and see what happens. You can list as many codes as you want.

Notice that for the instruction screens we have left the value at RT:any. This is because for instructions we don't really require any specific key be pressed. You could optionally limit it to the spacebar (57) or the enter key (28) or other key(s).

Hint: Whichever code you list first defines the "correct" key for the trial. If the subject hits the "correct" key, then a value of TRUE will be written to the Correct column of the data file. Other valid keys listed after the first code will produce a value of FALSE. This is useful of course only when you have one correct value but wish to define more than one valid keypress for a stimulus and can be ignored otherwise.