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

2.3.2.3 Get Key Release (#D)

The Get Key Release command pauses Cogsys until the subject releases any key. It then writes '&' and the reaction time in milliseconds to output, followed by a newline. It updates Cogsys variables 7 and 5 with the '&' key and release time, respectively.

Get Key Release takes three arguments: delay time, clear screen flag, and text. If a key has not been released after delay time milliseconds, then the screen will be cleared (if clear screen flag is set), and text will be displayed. If delay time is zero, the screen will not be cleared and text will not be displayed.

Name:
Get Key Release
Class:
Direct Keyboard Input
Code:
#D
Syntax:
#D[delay time,clear screen flag,text]
System:
Wait for any key to be released. After delay time, screen is cleared if clear screen flag is '1', and text is displayed. Cogsys variable 7 (COGVAR_KEY) is updated with the '&' key. Cogsys variable 5 (COGVAR_TIME) is updated with the release time.
Output:
The '&' key and release time are written to output.
Breakout:
NO
Test Files:
KEYD_T01.IN: Tests basic operation

 
@C
Testing the Key Release \#D command.
#W4000
Press and hold the 'z' key.#Z[z]

Now release the 'z' key.#D[0,0,]

You released the key after $SV5 milliseconds.
#W4000
Now press and hold the 'z' key.#Z[z]

Now release the 'z' key in 1 second.

#D[500,1,500 milliseconds have passed.  Key release ignored.]

Done.  Press any key to exit.#R

Examples:

input
Press and hold any key#R
Now release the key#D[300,1,Release the key]
subject
Presses the `a' key after 500 milliseconds.
Releases the `a' key after 700 milliseconds
output
a500
&700


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

This document was generated on November, 24 2008 using texi2html