Developer postOriginal post (opens in a new tab)

Version 0.7J - Partial Mouse Support

Switching to the desktop using Alt+Tab, Ctrl+Esc, Alt+Ctrl+Esc or Windows key should now behave as expected.

Ozapell Basic now supports mouse clicks from the left, right and middle buttons.

The subroutine MOUSEON shows the mouse cursor and enables mouse data from INPUTCODE.

The subroutine MOUSEOFF hides the mouse cursor and disables mouse data from INPUTCODE.

INPUTCODE will return 200 for left button, 201 for right button and 202 for middle button. If a mouse button was clicked, the variables MOUSEX and MOUSEY will contain the mouse click position. MOUSEOWNER will contain the owner value if available. (Used in sprite or button collision detection.)

Example program:

REM SET COLORS
TEXTCOLOR=COLORWHITE
BACKCOLOR=COLORBLACK

REM GRAPHICS MODE
MODE=1
SETMODE

REM TURN ON MOUSE
MOUSEON

REPEAT
INPUTCODE

SWITCH RESULT
REM LEFT MOUSE BUTTON
CASE 200
X=MOUSEX
Y=MOUSEY
COLORXY
ENDSWITCH

UNTIL FALSE

Left button clicks will draw a white pixel on the screen. Press ESC to exit the program.

Have fun!