How can I use R to record the time of a mouse click? -- Seth Roberts Associate Professor Psychology Department University of California Berkeley [[alternative HTML version deleted]]
Hi Seth, On Mar 10, 2007, at 11:55 PM, Seth Roberts wrote:> How can I use R to record the time of a mouse click?Perhaps ievent.wait() in iplots? (I haven't used this.) I found all sorts of functions (most of which I couldn't understand) by ?event. _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall McCormick Road Charlottesville, VA 22903 Office: B011 +1-434-982-4729 Lab: B019 +1-434-982-4751 Fax: +1-434-982-4766 WWW: http://www.people.virginia.edu/~mk9y/
Seth Roberts wrote:> How can I use R to record the time of a mouse click?Assuming they are mouse clicks on a plot from locator() or identify() then its as trivial as this: > plot(1:10) > locator(1); when=date(); print(when) $x [1] 3.787584 $y [1] 1.978947 [1] "Mon Mar 12 09:34:07 2007" but that only gets you one second resolution, and assumes zero delay between the click and the when=date() function call. Good enough? Barry