Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Double-press issue on Mac

edited June 2014 in OpenSesame

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.



  • edited 9:37PM

    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:

    • target sketchpad (300ms)
    • blank sketchpad (0ms)
    • keyboard_response

    This means that the keyboard_response starts collecting responses only 300 ms after the target sketchpad has 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_response doesn't flush pending keypresses, and therefore also collects 'old' keypresses from before the keyboard_response was 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:

    • inline_script_reset_response
    • target sketchpad (0ms)
    • keyboard_response1 (timeout=300ms)
    • blank sketchpad (0ms)
    • keyboard_response2 (timeout=7700ms), Run if [response] = None

    The inline_script_reset_response should reset the response variable to None, with the following code in the run phase:

    exp.set('response', 'None')

    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?


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

Sign In or Register to comment.