Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.2K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Time between mouse clicks

Looking for a minimalist stopwatch function that returns the time between two mouse clicks? In other words, I call the function. I click the computer mouse once. I click the computer mouse again. The function returns a real number representing the elapsed time between the mouse clicks.

POSTED BY: Jay Gourley
4 Replies

Have you seen EventHandler[]? And events like "MouseDown" and "KeyDown"? You would also be interested in CurrentValue["EventAbsoluteTime"] or maybe even CurrentValue["EventData"].

POSTED BY: Michael Rogers

Thanks, Michael. I had not seen EventHandler[]. I do not understand all the documentation for it, but I think it only works in a dynamic module. I want a function that returns the interval. I tried the line below without success.

EventHandler[time, {"MouseClicked" :> start = AbsoluteTime[];, "MouseClicked" :> time = AbsoluteTime[] - start}]

POSTED BY: Jay Gourley
POSTED BY: Michael Rogers
POSTED BY: Jay Gourley
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard