BASIC MOUSE Functions - fvdhoef/aquarius-plus GitHub Wiki

MOUSEX

TYPE: plusBASIC system function


FORMAT: MOUSEX

Action: Returns the current horizontal position of the mouse.

  • Returned value will be in the range 0 through 319, or -1 if no mouse was detected.

Examples:

X = MOUSEX

Sets variable X to the current horizontal position of the mouse.


MOUSEY

TYPE: plusBASIC system function


FORMAT: MOUSEY

Action: Returns the current vertical position of the mouse.

  • Returned value will be in the range 0 through 199, or -1 if no mouse was detected.

Examples:

Y = MOUSEY

Sets variable Y to the current vertical position of the mouse.


MOUSEB

TYPE: plusBASIC system function


FORMAT: MOUSEB

Action: Returns the current state of the mouse buttons.

  • The value returned will be the sum of the following values:
    • 1 if the left button is pressed.
    • 2 if the right button is pressed.
    • 4 if the middle button is pressed.
  • The value -1 is returned if no mouse is detected.

Examples:

MOUSEB AND 1

Returns 1 if the left button is pressed, 0 if it is not.

MOUSEB AND 2

Returns 2 if the right button is pressed, 0 if it is not.

MOUSEB AND 4

Returns 4 if the middle button is pressed, 0 if it is not.


MOUSEW

TYPE: plusBASIC system function


FORMAT: MOUSEW

Action: Returns the amount the mouse wheel has been moved.

  • The value returned is the amount of movement since the last time MOUSEW was referenced.
  • The returned value will be between -128 and 127.