Thursday, November 3, 2022

Mouse Input functions: 🆕 _MOUSEX, _MOUSEY, _MOUSEBUTTON, _MOUSEWHEEL ❇ GETMOUSE

The _MOUSEX function returns the current Y coordinate of the mouse pointer.

The _MOUSEY function returns the current Y coordinate of the mouse pointer.

The _MOUSEBUTTON function returns a 1 if the mouse button is currently pressed, and returns a 0 if the mouse button is currently not pressed.

The _MOUSEWHEEL function returns the accumulation of wheel decrements and increments that have been done with the mouse wheel since the last call to the function. (i.e a call to the function resets the number of wheel increments to zero.)

Pushing the wheel forward will decrement the number. Pulling the wheel backward will increment the number.


GETMOUSE

Although the syntax was setup in wwwBASIC to accommodate a mouse wheel parameter, there was never any code setup in the interpreter to get values for the mouse wheel.

The version of wwwBASIC in BASIC Anywhere Machine now gets the mousewheel value.

NOTE that GETMOUSE's retrieval of mousewheel value differs a bit with the _MOUSEWHEEL function.

Syntax

GETMOUSE x%, y%
GETMOUSE x%, y%, w%
GETMOUSE x%, y%, w%, b%

    • x% = horizontal position
    • y% = vertical position
    • w% = accumulation of wheel increments and decrements since the last call to the function  🐟
    • b% = button


No comments:

Post a Comment

🖥 Flower Tesselation: Testing DRAW and recursive SUB's

This BAM program inspired by Richard Russell's "Flower-like tesselation" BBC BASIC program posted on Facebook . Created in ord...