Howdy, Stranger!

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

Supported by

running inline scripts in parallel

Hi,

I am using a Cedrus box.
I managed to write inline script which reads the correct buttin number + RT for that


This is the code:

if dev.is_response_device():
dev.reset_base_timer()
dev.reset_rt_timer()

while True:
    dev.poll_for_response()
    if dev.response_queue_size() > 0:
        response = dev.get_next_response()
        # do something with the response

        keyPressed = response['key']
        isPressed = response['pressed']
        rt = response['time']

        dev.clear_response_queue()
        if isPressed:
            #print('isPressed')
            var.thisResponse = keyPressed
            var.thisTime = rt
            break

But I want to be able to run a loop where I show image and the user may or may not press on the button.
Something like the stop-signal-task in http://osdoc.cogsci.nl/3.1/manual/structure/coroutines/
but not with keyboard response, but my Cedrus response box.

I wanted to replace the kb_response with my getResponse inline script and got error that "inline_script" does not support coroutines.
I generated inline_script just like in the "Writing a custom coroutine" section (copied the 2nd example there) but again got the same error.

How can I have my inline_script run in parallel to the stimulus ?

Thanks!
Noa

Comments

Sign In or Register to comment.