Amos Professional Manual  Contents  Index

the Joystick and Mouse


As a default, the system counts the number of times that the HIDE command has been used, then reveals the pointer on screen when the number of SHOWs equals the number of HIDEs. To bypass this counting system and reveal the mouse pointer immediately, use SHOW ON.

E> Do
    For N=1 To 10
     Hide : Wait N : Show
    Next N
   Loop

Reading the status of the mouse
Whether or not the mouse pointer is visible, the computer must know two things in order to make any use of the mouse. It needs to recognise where the mouse pointer is as well as if any of the mouse buttons have been pressed.

X MOUSE
reserved variable: report or set the x-co-ordinate of the mouse pointer
X Mouse
x=X Mouse

X MOUSE reports the current location of the x-coordinate of the mouse pointer. Because movement is controlled by the mouse rather than by software, coordinates are given in hardware notation, which is demonstrated by the following example:

E> Do
    Print X Mouse
   Loop

This can also be used to set a new coordinate position for the mouse pointer and move it to a specific position on the screen. This is done by assigning a value to X MOUSE as if it was a Basic variable. For example:

E> For N=200 To 350
    X Mouse=N
    Print X Mouse
   Next N

Y MOUSE
reserved variable: report or set the y-coordinate of the mouse pointer
Y Mouse
y=Y Mouse

Y MOUSE is used to give the y-coordinate of the mouse pointer in hardware co-ordinates, or to reposition the mouse pointer on screen, and it is employed in exactly the same way as X MOUSE.

Back    Next
05.08.04