Howdy, Stranger!

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

Supported by

Listening to keyboard response

Dear OpenSesame community,

It might be quite basic but I still can't figure it out myself (due to my limited programming abilities).

I want to run 2 canvases (one after another) and to play sound between them.
Now, I want the participants to be able to press the keyboard in any time, while if they press before the sound, the trial will be over. The second canvas (after the sound) must be shown to 2 seconds either way (regardless to pressing any key). Importantly, I would like to log the response time of the response and the key pressed identity (space, 'l' etc.) for any case.

I hope I'm somewhat clear enough. Can anyone help?

Thanks!

Comments

  • Hi,

    Your description is not entirely clear to me, but my first impression is that coroutines might be what you're looking for. Coroutines allow you to do multiple things, such as presenting stimuli and collecting key presses, in parallel.

    See also:

    Does that help at all?

    Cheers,
    Sebastiaan

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

  • Hi,

    We'll need some more information.

    Firstly, what do the participants respond to? What is their task? What is the purpose of Sketchpad 1, of the sound, and of Sketchpad 2?

    I want the participants to be able to press the keyboard in any time, while if they press before the sound, the trial will be over.

    • If participants do not press a key before the sound, what should be the timeout of the first sketchpad? For example, should the experiment advance to the sound when the first sketchpad has been shown for 2 seconds without a response?
    • Does "the trial will be over" mean that neither the sound nor the second sketcphad should be shown?

    The second canvas (after the sound) must be shown to 2 seconds either way (regardless to pressing any key)

    • Should any response be collected during the second sketchpad? If so, what is the participant responding to here? The same thing as during Sketchpad 1, or does Sketchpad 2 require a new response?

    Cheers,

    Lotje

  • Dear Lotje and Sebastiaan,

    Thank you so much for your comments! Please forgive me for not being fully clear.

    I'm working on sort of a go/no go task. in this specific case I'm working on the No-go trials.

    I'm presenting a letter (for 100 msec) and then play a no-go tone (and the letter is still on the screen after the tone, that's the second sketchpad). if the participant is very quick and responds to the letter before the tone (even mistakenly), then the trial must be over and the next trial must begin (no tone or second sketchpad will be presented). if the participant responds after the tone, then he must wait for a 2000 msec for the trial to be over. Either way the responses keys are the same along the trial.

    I tried to use the coroutines Sebastiaan kindly suggested. It seems like the right way to approach it but I'm not fully understands how the programming of this feature works...

Sign In or Register to comment.