Welcome! Log In Create A New Profile

Advanced

How to save getkeypress function outputs "scane code" and "rt" as a uservariable

Posted by kalpajyotiH_123 
Dear Jaewon,

Could you please suggest a method for saving the getkeypress outputs as user variables, including the scanecode and rt?
Re: How to save getkeypress function outputs "scane code" and "rt" as a uservariable
January 31, 2024 10:26AM
I did as you suggested, but the error message still appears.

Kindly look at the picture that is attached.
Attachments:
open | download - getkeypress problem.JPG (32.7 KB)
Following to the above image, I run the script where I put getkeypress function in the userloop function and an error is shown again.

For the error, kindly look at the picture attached.
Attachments:
open | download - getkeypress problem1.JPG (40.1 KB)
Re: How to save getkeypress function outputs "scane code" and "rt" as a uservariable
February 01, 2024 05:15AM
Obviously you tried to save a variable that did not exist. Place bhv_variable() at the end of the script or after the variable is created.

Timing script functions are available only in the timing script. I do not know why you want to get a key input in the userloop, but you need to use a different method to do so. Please read the manual, if you did not.
https://monkeylogic.nimh.nih.gov/docs_CreatingTask.html#RuntimeVersion1
Thanks for the response; the Problem is solved.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.