Connecting Tech Pros Worldwide Help | Site Map

Finding location of the mouse without event object

beatsoup
Guest
 
Posts: n/a
#1: Jun 8 '06
Is there a way to find out the location of the mouse when an event
object is not handy? For example, let's say I want to wake up in 1
second and check where the mouse is. The function called by the
interval timer won't have an event object. How would the routine
determine the location of the mouse in that case?

Thanx for any information.

andy baxter
Guest
 
Posts: n/a
#2: Jun 8 '06

re: Finding location of the mouse without event object


On Wed, 07 Jun 2006 17:04:57 -0700, beatsoup wrote:
[color=blue]
> Is there a way to find out the location of the mouse when an event
> object is not handy? For example, let's say I want to wake up in 1
> second and check where the mouse is. The function called by the
> interval timer won't have an event object. How would the routine
> determine the location of the mouse in that case?
>
> Thanx for any information.[/color]

How about this:
- have a function which listens to onmousemove on whatever content pane
you're interested in.
- this is constantly writing the current mouse location to some global
variable (or a property of a global object, to save your namespace from
getting cluttered).
- your timer function just reads from that whenever it needs to know the
mouse location.

I've done something pretty much like this for the app I'm writing, and it
works nicely.

Closed Thread