User guide
To remove the Pointer from the screen use the * HIDEPOINTER command (see 5.6
later). In order to move the Pointer smoothly over the screen, the * MOVEPOINTER
command is used, which is a combination of both * HIDEPOINTER and * SHOWPOINTER
commands.
If you wish to find out the Mouse position, you may use either the OSWORD 64 or *
UPDATE commands (see 5:1 and 5:15 later).
A small demonstration program using the above commands is shown below!
10 MODE 4
20 *DESK
30 *WINDOW 5,20,30,5, DEMO1
40 VDU 26,23,1,0;0;0;0;
50 REM define pointer as arrow icon
60 *POINTER 80
70 REM display pointer
80 *SHOWPOINTER
90 REPEAT
100 REM erase and redraw pointer
110 *MOVEPOINTER
120 REM loop until button pressed
130 UNTIL NOT INKEY -129
140 REM erase pointer
150 *HIDEPOINTER
160 REM set cursor to Mouse position
170 *UPDATE
180 REM print icon 32 at cursor position
190 *ICON 32
200 *SHOWPOINTER
210 REM wait until. button released
220 REPEAT
230 *MOVEPOINTER
240 UNTIL INKEY-129
250 GOTO 90
The pointer commands *HIDEPOINTER, *SHOWPOINTER and *MOVEPOINTER
only work in the two colour modes 0 and 4. in other modes the error number 168 "illegal
mode" is produced. To use a pointer in the colour modes the following procedures may be
used.
1000 DEF PROCmovepointer
1010 *FX 19
1020 PROChidepointer
1030
1040 DEF PROCshowpointer
1050 LOCAL A%,X%,Y%
1060 A%=64:X%=&70:Y%=0:CALL &FFF1
1070 mx=!&70 AND &FFFF
1080 my=!&72 AND &FFFF
1090
1100 DEF PROChidepointer
1110 GCOL 3,7
1120 MOVE mx-16,my:DRAW mx+16,my
1130 MOVE mx,my-16:DRAW mx,my+16
1140 ENDPROC