[Q] handling mouse events (many questions)

Ned Konz ned at bike-nomad.com
Thu Apr 18 20:28:27 UTC 2002


On Thursday 18 April 2002 01:18 pm, Martin Drautzburg wrote:
> > Perhaps you can add code like this:
> > 
> > click: anEvent
> >       self isThereGoingToBeAnotherClick ifFalse: [ do something ]
> > 
> > The implementation of isThereGoingToBeAnotherClick is, of course,
> > left as an exercise for the reader <g>.
>
> I am working on it. I tried counting the clicks between Time now
> and Time now addTime: (Time fromSeconds: 1). But the resolution of
> 1 second seems to coarse :-)

Um, I was joking. There's no way that I know of to tell at the time of 
the first click whether the user is going to click again within a 
certain time.

However, if you're concerned about event timing, just use the 
timestamp in the event:

click: anEvent
	anEvent timeStamp

And if you want to get a comparable time value, use

Time millisecondClockValue

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list