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) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 22-Jul-07 Time: 18:11:43 ------------------------------ XFMail ------------------------------ ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.