[R] using R for a reaction-time experiment

(Ted Harding) ted.harding at nessie.mcc.ac.uk
Sun Jul 22 19:11:45 CEST 2007


On 22-Jul-07 16:38:02, Seth Roberts wrote:
> 
> I want to use R to run a reaction-time experiment:
> Something appears on the screen, I respond by typing something
> (one keystroke), the system measures the speed of my response.
> R would be great for this if only I didn't have to hit Enter
> to enter that keystroke. I am doing such experiments now but
> they require two actions per trial: hit keystroke, hit Enter.
> 
> Is there some way that R can be made to respond to a single
> keystroke (other than Enter)?

What operating system are you using? If it's Linux, there would
be ways to detect the keystroke (say "A") and immediately send
"A\n" (i.e. "A" followed by "enter") to a FIFO which R could be
watching. Then R would receive your single keystroke as if you
had followed it by pressing "Enter".

If you're using Windows, then unfortunately I haven't a clue.

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 22-Jul-07                                       Time: 18:11:43
------------------------------ XFMail ------------------------------



More information about the R-help mailing list