Howdy, Stranger!

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

Supported by

Question about recording timing of keypresses

Dear all,

I’ve been using Opensesame for some months now and I really like it. I have tried to create an experiment with it it and it worked pretty well, but I found a problem that I can’t solve.

In my experiment I would like to use stimuli (sentences) to which the participants can decide whether those are correct or incorrect by pressing different keys (e.g. "y", "n") . When these keys are pressed, the participant will get the next stimulus. However, I also would like that the program accepts a third keypress (e.g. "t") and measures its timing but I don’t want the program to present the next stimulus when this third key is pressed.

As far as I understand now if I don’t make “t” to be a possible response, than the program will not record the press of the “t” key. But if "t" is a possible response key, the program will automatically present the next stimulus when the key is pressed.
So my question is the following: how can I make the program record the “t” key without it presenting the next stimulus while other keys ("y","n") remain "regular" response keys?

Thanks in advance for the help!

Comments

  • Hi Darvas,

    You have two options here.

    1) Set the run_if field of the next stimulus to [response] != 't'
    However, this only works if the next stimulus that you refer to, is not the next trial, but just another stimulus in the current trial_sequence.

    2) Use inline_scripting

    kb = keyboard(keylist = ['y','n','t'])
    key, time = kb.get_key()
    if key in ['y','n']:
        # do stuff to present next stimulus
    

    Hope this helps.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.