That warning isn’t an issue. If you didn’t get any print statements then maybe event.keys isn’t working for you. Are you on a Mac? Do keyboard components work?
Use Print statements
When debugging, print statements can be very helpful to track down errors or unexpected behaviour.
I tend to use them in one of two ways:
print('trial setup started')
Sometimes I won’t know where the error is, especially if there is a problem during the initial setup of the components or Begin experiment code. The components of each routine are set up in turn from top to bottom. Therefore, if you have a flow with routines called start, trial and finish and put print('tri…
Test the installation
If you have just installed PsychoPy (or have upgraded and you have having issues with experiments that previously worked) I would recommend that you create a very simple experiment from scratch to test your installation.
Add a Text component from Stimuli. Keep the default values.
Add a Keyboard component from Responses. Keep the default values.
Save the file in an empty folder.
[|756px;x433px;]
Run the test.
Wait for the starting dialogue box to appear. Click OK.
[|37…
Use keyboard components instead of event.getKeys()
The keyboard component in PsychoPy Builder uses the Keyboard class, which has better timing than the older event module. If you want to identify whether a key has been pressed in Each Frame then code of the form
keys = event.getKeys()
can be replaced with
keys = []
if key_resp.keys: # Keyboard component should store all keys and not force the end of the routine
if len(key_resp.keys) > nKeys: # Add nKeys = 0 in Begin Routine
keys =…
1 Like