[R] detecting a key press

Martin Teicher martin_teicher at hms.harvard.edu
Sat Aug 14 04:26:31 CEST 2010


Hi Folks,

I'm relatively new to r.  I'd like to have a user respond by pressing a 1 or a 2 and determining their choice and the time of response.  Previous postings have indicated that keyboard responses can be processed using scan and readline but both seem to wait for the user to also press return.  Is there a way to detect the initial key press without requiring them to hit return?  

Thank you so much.

Martin H. Teicher
Department of Psychiatry
McLean Hospital / Harvard Medical School
Belmont, MA USA


More information about the R-help mailing list