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

2.3.2.4 Get Timed Key Response (#C)

The Get Timed Key Response pauses Cogsys until the subject presses a key, or until a specified time limit is reached. If no character is pressed within a given time limit, '&' is recorded as the key pressed, and Cogsys procedes processing the testlist. Either way, the Cogsys response key and response time variables are updated.

If the "@" key is pressed before the time limit has expired, the experiment is terminated.

Name:
Get Timed Key Response
Class:
Direct Keyboard Input
Code:
#C
Syntax:
#Climit

limit is a timelimit

System:
Cogsys variable 7 is updated with the key pressed, or '&'. Cogsys variable 5 is updated with the reaction time, or the timelimit.
Output:
The key pressed and time are written to output. If the timelimit limit is reached before a key is pressed, '&' is written as the key pressed, and limit as the time.
Breakout:
YES
Test Files:
TKYR_T01.IN: Tests basic operation

 
@C
Testing the Timed Key Response \#C command.
#W3000
Press the 'z' key.#C10000

You pressed the '$SV7' key after $SV5 milliseconds.
#W3000
This has been an illustration of the \#C command,
using \#C10000 to timeout after 10 seconds 
of no keyboard input.
#W5000
Now press the 'z' key after waiting 5 seconds.#C3000

The '$SV7' key was sent to output after $SV5 milliseconds.

This has been an illustration of the \#C command,
using \#C3000 to timeout after 3 seconds of no keyboard input.
#W4000
Done.  Press any key to exit.#R

Examples:

input
Press a key within 5 seconds: #C5000
cogsys
Displays the text and waits up to 5 seconds.
subject
Press the `z' key after 200 milliseconds.
output
z200

input
Press a key within 5 seconds: #C5000
cogsys
Displays the text and waits up to 5 seconds.
subject
Does nothing.
output
&5000


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

This document was generated on November, 24 2008 using texi2html