Hi
How can I get the exact time of key press?
Hi
How can I get the exact time of key press?
psychopy.event.getKeys takes a timeStamped argument, which you can set to True
.
Thanks a lot. but there is a TypeError:
âgetKeys got an unexpected keyword argument âtimeStampedââ.
The only reason I can think youâd get that error is if you have a very old version of psychopy or if thereâs a typo in the word timeStamped (check the case). Can you post that snippet of your code and the exact text of the error?
The version is v3.1.5.
I have put this code in the BeginRoutine tab:
a = Target_Response.getKeys(keyList=[âkâ,âsâ], timeStamped=True)
Target_Response is my keyboard component.
here is the Error: âgetKeys got an unexpected keyword argument âtimeStampedââ.
I see, Iâm less familiar with the newer syntax. You want these docs, the example shows how to get RT. If you want absolute time I believe youâd have to relate the RT to the start time of kb.clock
Thank you so much
Hi There,
This post might be useful
Also try using the demo in coder view >demos> input >keyboardNEW
Becca
The issue here is that your are confusing the event
module (which has a function called event.getKeys()
that allows you to check if a key has been pressed), with Builderâs Keyboard component, which has already done the checking for you, and you just query what it found. So you canât tell it after the fact what list of keys to check for and whether they should be time stamped or not: those decisions are already made in the settings applied within the Builder Keyboard component dialog box.
Regards, you shouldnât be using the event
module anymore: as Rebecca suggests, you should use the new Keyboard
class instead, which performs much better.
Builderâs keyboard component also uses this approach in the latest version. But you need to get it straight in your mind whether you are actually using code to check for keypresses in real time, or just querying Builderâs keyboard component after the fact.
thanks a lot
Thanks a lot