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

2.3.2.2 Get Specific Key Response (#Z)

The Get Specific Key Response command is just like the #R command, except that it will not return until a specific key has been pressed. It pauses Cogsys until the subject presses a desired 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.

Get Specific Key Response will terminate execution of the experiment if the "@" key is entered.

Name:
Get Key Response
Class:
Direct Keyboard Input
Code:
#Z
Syntax:
#Z[character]
System:
Wait for key character to be pressed. character can not be the `]' character. 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:
KEYZ_T01.IN: Tests basic operation

 
@C
Testing the \#Z command.  

NOTE: The '\@' command is the emergency exit key, in 
case you need it.
#W5000
Press the 'a' key#Z[a]

You pressed the '$SV7' key after $SV5 milliseconds.
#W2000
Press the 'A' key#Z[A]

You pressed the '$SV7' key after $SV5 milliseconds.
#W2000
Press the 'SPACE' key#Z[ ]

You pressed the '$SV7' key after $SV5 milliseconds.
#W2000
Press the 'Keypad 5' key. (Translates to 'E')#Z[E]

You pressed the '$SV7' key after $SV5 milliseconds.

Done.  Press any key to exit.#R

Examples:

input
Press the 'a' key#Z[a]
subject
Presses the `a' key after 200 milliseconds.
output
a200
input
Press the <SPACE> bar#Z[ ]
subject
Presses the `<SPACE>' bar after 800 milliseconds.
output
800


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

This document was generated on November, 24 2008 using texi2html