[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.2.1 Get Key Response (#R)

The Get Key Response is the classic response command. It pauses Cogsys until the subject presses a key. It then writes the key pressed and the reaction time in milliseconds to output, followed by a newline. It updates Cogsys variables 7 and 5 with the key and time, respectively.

Like most response commands, Get Key Response will terminate execution of the experiment if the "@" key is entered.

Name:
Get Key Response
Class:
Direct Keyboard Input
Code:
#R
Syntax:
#R
System:
Cogsys variable 7 (COGVAR_KEY) is updated with the key pressed. Cogsys variable 5 (COGVAR_TIME) is updated with the reaction time.
Output:
The key pressed and time are written to output.
Breakout:
YES
Test Files:
KEYR_T01.IN: Tests basic operation

 
@C
Press the 'z' key#R
You pressed the '$SV7' key after $SV5 milliseconds.
$AV100=V7 $AV101=V5 #W5000
Press the capital 'Z' key#R
You pressed the '$SV7' key after $SV5 milliseconds.
$AV102=V7 $AV103=V5 #W2000
Press the '6' key#R
You pressed the '$SV7' key after $SV5 milliseconds.
$AV104=V7 $AV105=V5 #W2000
Press the 'F1' key#R
You pressed the '$SV7' key after $SV5 milliseconds.
$AV106=V7 $AV107=V5 

The output file should have these response key
and time pairs:

$AV7=V100$SV7$SV101
$AV7=V102$SV7$SV103
$AV7=V104$SV7$SV105
$AV7=V106$SV7$SV107

Done.  Press any key to exit.#R

Examples:

input
#R
subject
Presses the `z' key after 200 milliseconds.
output
z200



This document was generated on November, 24 2008 using texi2html