KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Continuously tracking the position of the mouse, Part 2
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: July 28, 2006

To continuously keep track of the mouse coordinates you can use the "On Mouse Move" event.

For example, given a form that has two variables on it (variable1, variable2), enable the "On Mouse Move" event for the *form* and then add the following to the form method:

Case of
   : (Form event=On Mouse Move )
      GET MOUSE(variable1;variable2;unused)
End case

Note that the coordinates are tracked relative to the form window's position (as oppossed to screen position) in this case. For more information see the documentation for GET MOUSE:

https://www.4d.com/docs/CMU/CMU00468.HTM