Error getting tags :
error 404Error getting tags :
error 404 clickLoc | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
clickLoc
Basics
Expander triangle
Type
Function
Syntax

the clickLoc

clickLoc()

Introduced
1.0
Environment
Desktop,Web
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns the position of the most recent mouse click.
Examples

the clickLoc
if the clickLoc is the mouseLoc then send mouseUp to me

Additional Comments
Expander triangle

Use the clickLoc function to determine where a user clicked, or to determine whether the mouse pointer has moved since the last click.

Value:

The clickLoc function returns two integers separated by a comma.

Comments:

The first item of the returned value is the horizontal distance in pixels from the left edge of the clicked stack to the location of the click. (Use the clickStack function to identify which stack was clicked.) The second item of the returned value is the vertical distance from the top edge of the clicked stack to the location of the click.

The click location is the position of the mouse pointer when the user pressed the mouse button, not when the user released the button. In particular, inside a mouseDown handler, the clickLoc returns the position of the mouse as it was when the mouse down action occured.

The first item of the clickLoc is equal to the clickH. The second item is equal to the clickV.

User Comments
Expander triangle
User thumbnail
Craig Newman (dunbarx)
StarStarStarStarStar
Jun 8, 2009
The clickLoc function (and clickV and clickH) are persistent; they can return a value even after a wait command is executed, or integrated into a repeat loop. Other, similar "click" functions (clickText, clickLine, etc.) are not as robust.
One may therefore write a handler in one object to obtain information about text in a different object, using the mouse to pinpoint that text. For example, in a button script:
on mouseUp set cursor to cross wait until the mouseClick click at the clickLoc put the clickText into myVariable -- or any other similar function, clickChar, clickChunk, etc. end mouseUp
The mouse may be clicked on the remote text, and the clickText is obtained.
All other "click" functions must be invoked from within the same object in order to obtain a value; only the clickLoc (and its cousins) will work as illustrated above. The other functions will return empty otherwise.