Howdy, Stranger!

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

Supported by

Presneting stimuli only while a button is pressed

Hi to all,

I want to present a series of stimuli only while a certain button is pressed (i.e. the space button).
I already have the necessary part of the experiment for the presentation of the stimuli and the stimuli themselves.
Is there a way to do this?

Thanks
Amihai

Comments

  • Hi Amihai,

    There are multiple ways to do this, either with a script or coroutines item, but the easiest way depends on what you want to do exactly, and what you have programmed already. Could you upload the experiment here?

    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 Amihai,
    If you use an inline_script it may help to write a while loop, and ask for keylifts.
    You can find an example here: http://forum.cogsci.nl/index.php?p=/discussion/comment/14335#Comment_14335
    Good luck
    Stephan

  • Hi Sebastiaan, DahmSF,

    Thanks for the answers.

    Sebastiaan - I am attaching my experiment. Notice it is a bit "dirty" and has some scripts used for other purposes that I got from people in this forum (and for that I am grateful, I do not know how to code :smile: ). I want to add a script that will present the stimuli loop as long as the participant presses the space key. I would also appreciate advice on where to plant the script.

    DahmSF - I could not understand where is the example that you mentioned in the link you sent.

    Thanks again
    Amihai

  • Bump.
    Help anyone?

  • The example is in the experiment which is uploaded in the linked discussion. If you lift the button too early you get back to the beginning.
    --> There you need to keep the mouse button pressed, but you can easily change it to the space key on the keyboard.

Sign In or Register to comment.