Use $mouse to locate the position of the mouse. Then use:
$inrect(x,y,x,y,w,h)
to find if the mouse is inside the specified location (ie. the location of the edit box or other control).
You can also use $inpoly for this, but most controls are rectangular in nature, so $inrect is easier to use.