Page 1 of 1

Simulating a double click for a tool?

Posted: Sun Feb 26, 2006 11:31 am
by heyvern
Has anyone tried this or would this be possible?

Of course I am assuming a double click is not already available in lua or Moho... I didn't see one in the reference.

-------------------

It would have to be some kind of timer that could determine how quickly two mousedown/mouseups have occurred.

A timer that expires very quickly after the "first click" but if multiple mousedowns within that time a variable is assigned which would activate a different action within a tool function thingy.

I would like to add something like this in the modified universal select tool for selecting an entire mesh by double clicking.

This could add a lot of "extra" gizmos to existing tools... er... if it works.

------------------

I will try to play around with this and see what happens.

-Vern

Posted: Mon Feb 27, 2006 5:22 pm
by heyvern
Huh...

I am actually able to register a double-click using os.clock().

I store self.elapsedTime at the beginning of the tool script.

on mouse up I compare the time that has elapsed. If you are "using" a tool while the mouse is down then the time will always be larger than a "default" range.

For my script the default time it takes to process the whole mouse down/up procedure is about .08. But if you double-click on a point really fast... it goes faster... so that is what I am checking.

It isn't perfect... but if it limited to a specific spot... like double clicking a selected point or something... it might be useful.

It would have to be adjusted for each persons computer. Some would process the script faster.

Currently... it is only a "fake" double-click... not quite ready for prime time...

"I'm not a real double-click but I play one on TV"

This is probably a lost cause... but... a fun experiment.

-Vern

Posted: Tue Feb 28, 2006 12:13 am
by rylleman
Cool experiment, will probably be useful.