Howdy, Stranger!

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

Supported by

How to Record Keyboard Responses outside of the Block Loop?

edited February 2019 in OpenSesame

Hi everyone,

I am trying to create an experiment that uses the RSVP technique. My experiment aims to find out how fast can participants detect human faces in a series of images displayed (85ms each image).

I'm using Open Sesame and have already created a draft. However, because we cannot detect a face and press for a response in 85ms, I am having an issue. I cannot use the timeout feature in the Keyboard item because after 85ms, the keyboard response for that particular image will expire in that loop.

I tried using the Coroutine item. However, it does not seem to solve what I need. The Coroutine item has a timeout function as well, so the visual sketchpad and the keyboard response are tied to the Coroutine. Hence, the keyboard response will still be 85ms.

What I need is for the image and keyboard response to run in tandem and not in serial. In Python, they call it a thread?
For example:

Experiment:
Stimulus Distractor, Distractor, Distractor, FACE 1, Distractor, Distractor, Distractor, FACE 2...

Keyboard Response:
When a participant sees FACE 1 (which shows for 85ms and we can't respond in time), they will press for a response. The timing of the response will likely be 400ms to 500ms. However, I'm not able to record the responses for the delayed response from the program I have drafted.

Can anyone please advise? I'm not a technical person and have a limited knowledge on python. Will appreciate it!

p/s: the program also says I have too many key loggers which may be messy. However, I have 7 conditions for my experiment. So if there's a way to put a key logger in a better way, please let me know!

Comments

  • Hi,

    the program also says I have too many key loggers which may be messy.

    The message says you have too many unlinked loggers. It is perfectly fine to add a logger to each of your 7 loops, but try to use the same logger item every time.

    As for the RSVP, I would use a while loop inside an inline_script to do the task. Below an example that should demonstrate the principle.

    import random
    
    # prepare a keyboard
    kb = Keyboard(timeout = 2)
    
    # collect all the unique displays here
    canvasses = []
    
    # create stimuli 
    no_stim = 18
    stim = range(no_stim)
    random.shuffle(stim)
    t_idx = random.choice(stim)
    
    # add text to canvas and add canvasses to list
    for n in range(no_stim):
        cv = Canvas()
        cv['stim'] = Text(stim[n],color = 'white')
        canvasses.append(cv)
    
    canvasses[t_idx]['stim'].color = 'red'
    
    cur_idx = 0
    resp = None
    stim_dur = 200
    t0=canvasses[cur_idx].show()
    t1=clock.time()
    while True:
        if resp == None:
            k,t=kb.get_key()
        if k!=None:
            resp = k
            resp_time = t-t0
        if clock.time()-t1>stim_dur:
            cur_idx += 1
            if cur_idx == len(canvasses):
                break
            t1=canvasses[cur_idx].show()
    
    

    Let me know if you need help.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games