' TEXTMUIS.BAS Changes the mousepointer ' Auteur : Egbert Zijlema (E-mail: E.Zijlema@uni4nn.iaf.nl) ' Datum : 1 May 1996 ' Copyright status: Public Domain ' Info: function 10 of INTERRUPT &H33 (mousecontrol) defines the shape ' of the mousepointer in textmode (SCREEN 0), using a valid ASCII code. ' ' [Depending on the value loaded into the BX-register ( 0 or 1 ) ' This routine can also be used to change the text-cursor. Since ' BASIC-programmers can use the command locate as well, this is ' just a side note] ' ' Register values: ' AX = 10 ; function ' BX = 0 ; command change mousepointer ' CX = &H77FF ; screenmask for default cursor ' CX = 0 ; no mask for altered cursor ' DX = &H7700 ; color and shape default cursor ' DX = (attrib * 256) + ascii ; color + ascii character defines cursor ' Reset default cursor: ' If the parameter Char? is 0 (or 255) the default cursor will appear. DEFINT A - Z SUB MouseOn ' by Dave Navarro (in MOUSUNIT.INC) ! push DS ; save DS for PowerBASIC ! mov AX, 1 ; mouse driver function 1, turn on cursor ! int &H33 ; call driver ! pop DS ; restore DS END SUB SUB MouseOff ' by Dave Navarro (in MOUSUNIT.INC) ! push DS ; save DS for PowerBASIC ! mov AX, 2 ; mouse driver function 2, turn off cursor ! int &H33 ; call driver ! pop DS ; restore DS END SUB SUB MouseShape(BYVAL Char AS BYTE) DIM Attr AS LOCAL BYTE DIM Mask AS LOCAL INTEGER DIM Shape AS LOCAL INTEGER IF Char? < 0 OR Char? > 255 THEN ' Use valid ASCII-code! EXIT SUB END IF IF (pbvScrnCard AND 1) = 0 THEN Attr? = 14 ' Yellow mouse for color ELSE Attr? = 7 ' White mouse for mono END IF IF Char? = 0 OR Char? = 255 THEN ' Reset default Mask = &H77FF Shape = &H7700 ELSE Mask = 0 ' No screenmask Shape = CINT(Char? + (256 * Attr?)) ' color and shape of cursor END IF ! push DS ; Reserve DS for PB ! mov AX, 10 ; Function 10 ! xor BX, BX ; BX leeg (= 0) ! mov CX, Mask ; Screenmask ! mov DX, Shape ; Shape and color ! int &H33 ; Call mousecontrol ! pop DS ; Reset DS END SUB ' testing procedure ' ' NOTE: If you run this program from the IDE, nothing will happen. ' You need to compile this program to an .EXE, and run it. ' All mousecalls will be intercepted when run from the IDE CLS LOCATE 10, 10 : PRINT "Move the pointer to this line, and hir a key" MouseShape 2 ' smiley = chr$(2) MouseOn ' show mousepointer DO ' Wait until keypress LOOP UNTIL LEN(INKEY$) MouseShape 0 ' 0 = reset default pointer LOCATE 12, 10 : PRINT "As you can see, the default mouse is transparent" LOCATE 13, 15 : PRINT "Hit a key to end this demonstration" DO ' Wait until keypress LOOP UNTIL LEN(INKEY$) MouseOff ' disable mousepointer END