[solved] count keystrokes in a specified time
HI ,
I am looking at counting the keystrokes in a specified set duration .
want to know how can this be achieved .
I do see a variable "count_keyboard_response".
which i am currently unable to use .
It would be great if there is some pointers to this.
Regards,
Sundar.
Comments
Hi Sundar,
The
count_keyboard_responsevariable tells you how often thekeyboard_responseitem has been run. Each keyboard_response item, per definition, collects only one keypress.If you would like to count how often participants press a key, you could do with a little Python inline scripting:
The code is pretty self explanatory. Also, please note that everything below the marker can be replaced by a blank sketchpad with a Duration of 1000 ms, and a sketchpad with a Duration of
keypressand a text like this:You pressed Space [keypress_count] times.Good luck!
Thanks Edwin,
This trick worked pretty well with python script.
Also let me know how do i pass this variable "presscount"
to be logged in in the logger .
Regards,
Sundar.
Go to your logger, click
Add custom variable, typekeypress_count.Also, it might be wise to go through some tutorials and the documentation pages.