Link to Experiment Online: https://pavlovia.org/CAMaitland/socialmotivationandidentity
I recently updated Psychopy and some old Py code that previously worked no longer does due to the changes in keyboard functions.
In my experiment, participants need to push the left OR right key multiple times in order to make a choice and progress to the next routine. The code below should mean that if a participant pushes the left then right key (i.e. a mistake) the keyboard will reset itself, such that it deletes the keys already pushed and is ready for new key input. Here is the code that previously worked:
if key_resp_14.keys == ['left', 'right']: event.clearEvents(eventType='keyboard') key_resp_14 = event.BuilderKeyResponse() theseKeys = event.getKeys(keyList=['left', 'right'])
I think it’s related to changes in clearEvents, but I’m unsure. Anybody have any ideas of how to code this using the updated functions?