PennController for IBEX › Forums › Support › Recording keypress with a timer › Reply To: Recording keypress with a timer
Hi,
Key elements remain active until you explicitly disable them. By default, log will only report keypresses that validate a wait command on the Key element. In your case, you have no wait command on the “audioanswer” Key element, so you use log("last"). Because you end the trial by requiring that your participant press the spacebar, and because that key is also part of the “audioanswer” keys, the last keypress that was captured by your “audioanswer” Key element necessarily is a spacebar, which is reported as a space character in your results file (...,Key,audioanswer,PressedKey, ,1611166764724,...)
Here’s one solution to your problem:
newKey("audioanswer", "Y", " ") .log("last") .setVar("inputanswer") .callback( getTimer("time limit").stop() ) , getTimer("time limit") .wait() , getKey("audioanswer").disable()
Let me know if you have questions
Jeremy