Howdy, Stranger!

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

Supported by

[solved] Recording first keypress

edited March 2015 in OpenSesame

Hello dear OpenSesame users;

I target some contiguous questions to the subjects via the form_text_input and collect the reaction times via the logger. My main purpose is to obtain the first keypress time following the question. But the programme is giving me the time that the subjects press the ENTER key and move on to the other questions. I have no interest in the whole answering time, i have to obtain exactly the first keypress time (Interval between appearing the form_text_input and first keypress time). Is there an option for this purpose? For example can we add the first keypress as a "new variable"?

Thank you in advance.

Comments

  • edited March 2015

    Hi Deniz,

    I'm afraid the solution to your question is not trivial. It is not impossible, but it requires you to do quite some inline_coding. Also, I don't think you should you use the form_text_input here. Instead, you could manually define a basic version of this item, with the addition that, the after the first key press a variable is created that contains the reaction time for this first stroke.

    The general procedure looks like this (all placed in an inline_script):

    1) in a while loop, your prompt for subjects to write something (e.g. input())

    2) As soon as the subjects starts to type, you save the reaction time in a variable (In case the input() function doesn't stop until Enter was pressed, you can force it to break for any input and make the following actions depending on which key was pressed)

    3) In every iteration of the loop, you update a string containing everything that is already written and print it to the canvas (OpenSesame's canvas.text())

    4) As soon as Enter was pressed, you break the loop and go to the next element.

    I hope this is enough, to get you started. Let us know if you need more help with it.

    Good luck,

    Eduard

    Edit: Haven't seen this post, before the one in the other thread. Just ignore that one.

    Buy Me A Coffee

  • edited 1:41PM

    Thanks for your help and kindness Eduard,

    I think i should learn some inline_coding in the coming days.

    Have a nice working day.

Sign In or Register to comment.