The [[_MOUSEX]] function returns the current horizontal (column) mouse cursor position when read after [[_MOUSEINPUT]].
{{PageSyntax}}
: {{Parameter|pixelColumn%}} = [[_MOUSEX]]
{{PageDescription}}
* [[SCREEN]] 0 returns the [[INTEGER]] horizontal text column position (from build 20170817/62 onward); older versions return a [[SINGLE]] horizontal text column position. Use [[INTEGER]] variables to avoid floating decimal returns.
* Graphic screen modes 1, 2 and 7 to 13 and [[_NEWIMAGE]] 32 bit return the [[INTEGER]] pixel columns.
* To calculate text columns in graphic modes, divide the return by 8 or the [[_FONTWIDTH]] of [[_FONT]] characters.
* [[_MOUSEINPUT]] must be used to detect any changes in the mouse position and is '''required''' for any coordinate returns.
==QBasic/QuickBASIC==
* In [[SCREEN]] 0, QBasic's [[CALL ABSOLUTE|ABSOLUTE]] returned graphic coordinates. QB64 mouse functions return the text coordinates.
{{PageExamples}}
''Example:'' A simple mouse drawing board using [[_MOUSEX]] and [[_MOUSEY]] coordinate values.