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

2.3.7.5 Timed Response Any Button (#Q)

The Timed Response Any Button command pauses Cogsys execution until any of the gameport buttons are pressed or the specified timelimit expires. Each button is given a letter:

`A'
Joystick 1, Button 1
`B'
Joystick 1, Button 2
`C'
Joystick 2, Button 1
`D'
Joystick 2, Button 2

The corresponding letter is written to output with response time. If no key pressed within the time limit, is written to output.

Warning: If more than one button is pressed, the binary code representing the button combination is written as key pressed. Note that this may confuse programs expecting pure ASCII text.

Name:
Timed Response Any Button
Class:
Gameport
Code:
#Q
Syntax:
#Qtimelimit
System:
Waits up to timelimit milliseconds for a gameport button to be pressed. Cogsys variable (COGVAR_KEY) is updated with the letter code. Cogsys variable (COGVAR_TIME) is updated with the reaction time.
Output:
Writes the letter corresponding to the button pressed. If no button is pressed, writes `' TIMEUP_RESP_CHAR. If multiple buttons are pressed, writes a binary composite code.

Breakout:
NO

Test Files:
`TBTR_T01.IN'
tests basic operation

Examples:

input
#Q100
subject
Presses Joystick 2, Button 1 after 74 milliseconds.
output
C74



This document was generated by Usman Muzaffar on June, 28 2000 using texi2html