thanks Greg
Bill

On Monday, September 30, 2013, Greg Snow <538280@gmail.com> wrote:

> Some code that you can look at for examples of capturing the mouse
> position without clicking include the playSudoku function in the sudoku
> package and several functions in the TeachingDemos package including
> HWidentify, HTKidentify, dynIdentify, and TkIdentify.
>
>
> On Mon, Sep 30, 2013 at 8:46 AM, Stanislav Aggerwal <
> stan.aggerwal@gmail.com <javascript:_e({}, 'cvml',
> 'stan.aggerwal@gmail.com');>> wrote:
>
>> Consider the following:
>>
>> par(mar=c(0,0,0,0),xaxs = 'i',yaxs='i')
>> plot.new()
>> for(i in 1:20)
>>   {
>>   z <- matrix(runif(256*256), ncol=256)
>>   dev.hold()
>>   image(z, col=grey(0:255/255),zlim=c(0,1),useRaster=TRUE)
>>   dev.flush()
>>   Sys.sleep(.1)
>>   }
>>
>> I would like to continuously display the animation until a mouse click
>> happens. Obviously, locator() can't be used for this, because it will halt
>> the animation while waiting for the mouse click. So something like this
>> won't work:
>>
>> while((r<-locator(n=1)) == NULL)
>>   {
>>   z <- matrix(runif(256*256), ncol=256)
>>   dev.hold()
>>   image(z, col=grey(0:255/255),zlim=c(0,1),useRaster=TRUE)
>>   dev.flush()
>>   Sys.sleep(.1)
>>   }
>>
>> Can somebody suggest a way to get user input while displaying the
>> animation? I am willing to use a keypress if not the mouse. Essentially, I
>> need an input routine that does not wait for a response but just checks at
>> one instant (like kbhit in C).
>>
>> Thanks very much for any help.
>>
>> Stan
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@r-project.org <javascript:_e({}, 'cvml', 'R-help@r-project.org');>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.
>>
>
>
>
> --
> Gregory (Greg) L. Snow Ph.D.
> 538280@gmail.com <javascript:_e({}, 'cvml', '538280@gmail.com');>
>

	[[alternative HTML version deleted]]

