Futurebasic/Language/Reference/on mouse

Description
This statement designates a particular function or subroutine as a mouse-event handling routine. A mouse-event handling routine is called in response to a mouseclick which occurs inside the content region of the currently active window (but not inside any buttons, scrollbars, edit fields nor picture fields).

After such a mouseclick occurs, FB does not call your designated routine immediately. Instead, your program continues executing until a  statement is reached. At that time,  will call your designated routine once for each mouseclick event that occurred; your designated routine should examine the  functions to get information about the event.

Note: If you use the  syntax, then   must refer to a function which was defined or prototyped at an earlier location in the source code. Your mouse-event handling function should not take any parameters, nor return a result.

If your program does not use, you can use the  ,  ,   and many other position functions (outlined in the FB Mouse Group of the constants document) to track mouse activity.