[solved] Double-press issue on Mac
Hi,
Our lab is running an experiment for which we are measuring reaction time after a participant's key-press to stimuli. The response is a single key-press that is supposed to trigger the next trial, but on some trials it's requiring two key-presses instead of one which interferes with our reaction time data. However, it only seems to be a problem on our Mac computer and not our PC. We run the same script on both computers, so this shouldn't be happening. We have all duration times set correctly, so we can't figure out why it does this. We have the 27.2 program on both the Mac and the PC.
Our experiment is structured so that we have a sketchpad presenting a stimulus for 300ms followed by a blank sketchpad whose duration is set to zero (this is the response window), and then a keyboard response icon with duration set to 8000. Again, the program is correctly logging RT and accuracy for most of the trials, and the error is not linked to a specific trial type. And again, the identical script works just fine on the PC. If you could help, that would be great. Thanks.
Emily
Comments
Hi Emily,
I think this is related to a bug in the Mac OS version, in which keypresses are not flushed. Basically, your structure is as follows:
This means that the
keyboard_responsestarts collecting responses only 300 ms after the targetsketchpadhas been shown. All keypresses that are faster than 300 ms are therefore not recorded, and you have to press the key again, as you noticed.So this is actually what your experiment is supposed to do, even though you probably didn't intend it this way. On Mac OS, things go 'wrong' because the
keyboard_responsedoesn't flush pending keypresses, and therefore also collects 'old' keypresses from before thekeyboard_responsewas called. But the timestamps of those keypresses (and therefore your RTs) will probably be incorrect. Does this make sense?In your case, you could probably implement your structure as follows:
[response] = NoneThe
inline_script_reset_responseshould reset theresponsevariable to None, with the following code in the run phase:So this structure will first wait for a keypress for 300 ms, then blank the screen, and then wait for a keypress for another 7700 ms, if no keypress was collected yet. Does that make sense?
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!