Saturday, May 6, 2023

✏ _MOUSEBUTTON and GETMOUSE

For both functions, "1" would be returned to indicate that a mouse button is pressed.

Now, both functions return "-1" (i.e. the system constant TRUE) to indicate that a mouse button is pressed.

Unchanged: a "0" (i.e. the system constant FALSE) is returned to indicate that a mouse button is NOT pressed.

In any previously created BAM programs, you will need to change things like "IF _MOUSEBUTTON = 1" to one of:

  • "IF _MOUSEBUTTON = TRUE"
  • "IF _MOUSEBUTTON = -1"
  • "IF _MOUSEBUTTON"

_MOUSEBUTTON

The _MOUSEBUTTON function returns a -1 (i.e. the system constant TRUE) if the mouse button is currently pressed, and returns a 0 (i.e. the system constant FALSE) if the mouse button is currently not pressed.

Syntax

_MOUSEBUTTON
  • Return value
    • 0 (i.e. system constant FALSE) when no mouse button is currently pressed
    • -1 (i.e. system constant TRUE) when a mouse button is currently pressed



GETMOUSE

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
    • value = 0 (i.e. system constant FALSE) when no mouse button is currently pressed
    • value = -1 (i.e. system constant TRUE) when a mouse button is currently pressed

No comments:

Post a Comment

📚 FUNCTION (and SUB): variable arguments, by default, are "passed by reference"

Preamble A primer on "call-by-reference" vs "call-by-value" BAM HOWTO (BTW:  "call-by-reference" aka "pas...