mouseX

Returns absolute X mouse coordinate on display.
Old Xmouse syntax is still valid but discouraged.

Syntax:
variable = mouseX

Example:
while not key(k_esc)
    locate(0,0)
    prints( "Current X mouse coordinate is: " & mouseX )
    prints( "Current Y mouse coordinate is: " & mouseY )
    waitVBL
    cls
wend

See also mouseScreenX(), mouseScreenY() and mouseY commands.