5748285 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$ cat -n mouse22.bas
   1: DECLARE SUB Pause ()
   2: DECLARE SUB MouseStatus (lb%, rb%, xMouse%, yMouse%)
   3: DECLARE SUB MouseRange (x1%, y1%, x2%, y2%)
   4: DECLARE SUB MousePut (X%, y%)
   5: DECLARE SUB MouseHide ()
   6: DECLARE SUB MouseDriver (ax%, bx%, cx%, dx%)
   7: DECLARE SUB MouseShow ()
   8: DECLARE FUNCTION MouseInit% ()
   9: 
  10: shared Mouse$
  11: Mouse$ = SPACE$(57)
  12: FOR I% = 1 TO 57
  13:   READ A$
  14:     H$ = CHR$(VAL("&H" + A$))
  15:       MID$(Mouse$, I%, 1) = H$
  16:       NEXT I%
  17:       DATA 55,89,E5,8B,5E,0C,8B,07,50,8B,5E,0A,8B,07,50,8B
  18:       DATA 5E,08,8B,0F,8B,5E,06,8B,17,5B,58,1E,07,CD,33,53
  19:       DATA 8B,5E,0C,89,07,58,8B,5E,0A,89,07,8B,5E,08,89,0F
  20:       DATA 8B,5E,06,89,17,5D,CA,08,00
  21:       CLS
  22:       ms% = MouseInit%
  23:       IF NOT ms% THEN
  24:         PRINT "Mouse not found"
  25:           END
  26:           END IF
  27:           SCREEN 0
  28:           MouseShow
  29:           1 MouseStatus lb%, rb%, y%, X%
  30: 
  31:           SUB MouseDriver (ax%, bx%, cx%, dx%)
  32:             DEF SEG = VARSEG(Mouse$)
  33:               Mouse% = -32516
  34:                 CALL Absolute (ax%, bx%, cx%, dx%, Mouse%)
  35: 
  36:                 END SUB
  37: 
  38:                 SUB MouseHide
  39:                  ax% = 2
  40:                   MouseDriver ax%, 0, 0, 0
  41:                   END SUB
  42: 
  43:                   FUNCTION MouseInit%
  44:                     ax% = 0
  45:                       MouseDriver ax%, 0, 0, 0
  46:                         MouseInit% = ax%
  47:                         END FUNCTION
  48: 
  49:                         SUB MouseShow
  50:                           ax% = 1
  51:                             MouseDriver ax%, 0, 0, 0
  52:                             END SUB
  53: 
  54: SUB MouseStatus (lb%, rb%, xMouse%, yMouse%)
  55: ax% = 3
  56: MouseDriver ax%, bx%, cx%, dx%
  57: lb% = ((bx% AND 1) <> 0)
  58: rb% = ((bx% AND 2) <> 0)
  59: xMouse% = cx%
  60: yMouse% = dx%
  61: END SUB
  62: 
5748286 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-05-09 21:05:18