Howdy, Stranger!

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

Supported by

Building time reproduction task

Hey I wish to build a time reproduction tasks where the participants are required to reproduce the duration of a standard stimulus. They need to long press a key. It would be great if you vould help me in how to insert a long key press response and how to log the same.

Thanks in advance for your response.

Comments

  • Hi Saumya,

    I am not 100% sure, but this sounds like a usecase for the keyrelease functionality:

    So you would need to 2 keyboard items. In the first one you set it to keypress (to start the measurement), and directly after a keyrelease. (Potentially the first one is unnecessary, try it out!)

    Eduard

    Buy Me A Coffee

  • I tried similarly building the experiment but my screen is getting stuck at the reproduction phase. Van you please guide me regarding the same?

    Thanks

  • Can you share your experiment? A screenshot is not quite sufficient to spot the problem.

    Eduard

    Buy Me A Coffee

  • I have attached the experiment for your reference. Thanks a lot for your help.

  • Hi @Saumya,

    I checked your experiment and there are a number of issues:

    1. the name of the space bar is not spacebar but space (see the list available keys button in the keyboard_response item)
    2. Keyrelease is not supported in Psychopy yet. Choose a different backend in the general properties tab (e.g. Expyriment)
    3. Some of your sketchpads have keypresses as durations. This is quite confusing from a user point a view. Consider changing them to time-based durations, or maybe use a mouse response (that is not per se an issue for the keyrelease, it is just hard to know what is going on if you have to press the key 5 times per trial, one of which matters only for the task)

    Hope this helps,

    Eduard

    Buy Me A Coffee

  • Hey!

    Thanks a lot for your suggestions.I have made the necessary changes. I had another query I want my participants to press the spacebar as the cue appears and continue the keypress till they reproduce the duration in the new sketchpad. Can you help me regarding the same as well?

  • If you need keyrelease across sketchpads, you need to use an inline_script to present visual stimuli and a poll the key release function.

    Something like that:

    # define the Canvas objects
    cv1 = Canvas()
    cv2 = Canvas()
    
    # define the Keyboard
    kb = Keyboard()
    
    # draw somethign onto the Canvas
    cv1.text("Canvas1')
    cv2.text("Canvas1')
    
    # define duration of canvasses
    cv1_offset = 1495
    cv2_offset = 2995
    
    # start presentation
    start_time = cv1.show()
    while True:
        # if no response after 2nd canvas, thats a timeout
        if clock.time() - start_time> cv2_offset:
            response = none
             break    
        # time to shwo the second canvas
        if clock.time() - start_time> cv1_offset:
             cv2.show()
       # poll the response and break if there is a key release
       response, time = kb.get_key_release(timeout=5)
       if response:
           break
    

    I haven't tested it, but this should give you the idea.

    Eduard

    Buy Me A Coffee

  • Thanks a lot

Sign In or Register to comment.