Howdy, Stranger!

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

Supported by

[solved] How to get out of sequence without stopping the experiment

edited March 2015 in OpenSesame

Hello there!

I'm currently doing a thesis research. My research is about priming. I want to prime anti social behaviour with a game. Afterwards I want participants to ''help'' an other study where they need to ''measure'' reaction time. They need to press on ''q'' as fast as possible when they see a circle. They can't decide for themselves when they want to stop.

I want to make a ''stop'' button with the keypress p. But how is this possible without stopping the whole experiment (so not pressing on escape). Thank you.

Comments

  • edited March 2015

    Hi there!

    I assume you already have the first part running? (i.e. press q as fast as possible). How to go about realizing this stop button might depend on how you've constructed the experiment so far.
    For instance, if there is a loop repeating indefinitely (with a circle appearing every iteration) you could add a second button option to the code that collects keyboard responses:

      from openexp.keyboard import keyboard
      my_keyboard = keyboard(exp, keylist=['p', 'q'])
    

    And later, in the loop, I assume you have something like response = my_keyboard.get_key(). Here, you add the command:

      if response == 'p':
          break
    

    Now we're out of the loop and will continue in whichever way you want.

    Let me know if it works. Good luck!

    Josh

Sign In or Register to comment.