Task

Get the current location of the mouse cursor relative to the active window.

Please specify if the window may be externally created.




 
LiveCode Builder (LCB) is a slightly lower level, strictly typed variant of LiveCode Script (LCS) used for making add-on extensions to LiveCode Script
 
-- results will be a point array struct like [117.0000,394.0000] relative to the current widget's view port
use com.livecode.widget -- include the required module
--- in your handler:
variable tPosition as Point -- type declaration, tPosition is a point array struct
put the mouse position into tPosition 
variable tRect as Rectangle -- type declaration, tRect is a rect array struct, something like [0,1024,0,768] 
put my bounds into tRect
if tPosition is within tRect then
   log "mouse position is within the widget bounds"
end if
 