Howdy, Stranger!

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

Supported by

Keyboard Response for a Set Duration

Hi Everyone, first of all, i'd like to thank this big community for all the work.

Second, my real issue, i've been trying to collect a keyboard response, but without it inmediatly going to the next item.
So far i've tried:

-opening the inline script for the keyboard responde item a changing the set duration to 6000 ms, so it looks like this:

set timeout 6000
set flush yes
set duration 6000
set description "Collects keyboard responses"
set allowed_responses "1;2;3;4"

But it keeps on going to the next item right after the keyboard response.

-Puting the keyboard response before the sketchpad that presents the options, but for clear reasons tha did not work.

I need this becouse i need the experiment to be the exact ammount of time for every subject, but im still recording the response times. So i'm open for ideas.

Thanks in advance to everyone.

Comments

  • edited July 2016

    Hi Arturo,

    You could accomplish this in two ways. First, you can do inline_scripting (not to difficult). Second, you can present another sketchpad after the keyboard_response item and pretend to wait during the keyboard_response by showing the exact same sketchpad as was visible while you were waiting for the response. Set the duration of this sketchpad to 6000 ms

    1)

    # put this code in the run phase of an inline script and replace the keyboard_response with it
    
    # in case you want to specify a certain timeout, you can also set it here
    kb = keyboard(keylist=['1', '2','3','4'],timeout=infinite)
    # sample for any keystrokes
    kb.get_key()
    # once something is pressed wait for 6 seconds
    clock.sleep(6000)
    

    Hope this helps.

    Eduard

    Buy Me A Coffee

  • Thanks! It worked. It was really simple, i fell bad for not thinking of that!.

    Thay you again!

Sign In or Register to comment.