home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY5 / MICE.ZIP / MICE.BAS next >
BASIC Source File  |  1990-08-18  |  3KB  |  114 lines

  1. $LINK "MICE.OBJ"
  2.  
  3. DECLARE FUNCTION GetMickeys&()
  4. DECLARE FUNCTION GetMousePage%()
  5. DECLARE FUNCTION IsMouse%()
  6. DECLARE FUNCTION MouseButtons%()
  7. DECLARE FUNCTION MouseInfo&()
  8. DECLARE FUNCTION WhereMouse&()
  9. DECLARE FUNCTION MouseType%()
  10.  
  11. DECLARE SUB ExcludeMouse(integer,integer,integer,integer)
  12. DECLARE SUB HideMouse()
  13. DECLARE SUB MousePenOff()
  14. DECLARE SUB MousePenOn()
  15. DECLARE SUB MouseSpeed(integer)
  16. DECLARE SUB MouseWindow(integer,integer,integer,integer)
  17. DECLARE SUB MoveMouse(integer,integer)
  18. DECLARE SUB ResetMouse()
  19. DECLARE SUB RestoreMouse()
  20. DECLARE SUB SetMickeys(integer,integer)
  21. DECLARE SUB SaveMouse()
  22. DECLARE SUB SetMouseSensitivity(integer,integer,integer)
  23. DECLARE SUB SetMousePage(integer)
  24. DECLARE SUB ShowMouse()
  25.  
  26.  
  27. '-----------------------------------------------------------------------------
  28. ' Sample program to demonstrate some of the mouse routines
  29. '-----------------------------------------------------------------------------
  30.  
  31. cls
  32.  
  33. a% = IsMouse%        ' check to see if mouse is present
  34.  
  35. select case a%
  36.   case = -1
  37.     print "You have no mouse!"
  38.     stop
  39.   case else
  40.     print using "Your Mouse has ### buttons.";a%
  41.     a& = mouseinfo&
  42.     major& = (a& / 65536) / 256
  43.     minor& = (a& / 65536) mod 256
  44.     type& = (a& mod 65536) / 256
  45.     irq&  = (a& mod 65536) mod 256
  46.     vers = major& + (minor& / 10)
  47.     print using "Version ####.##  Type ####  IRQ ####";_
  48.       vers,type&,irq&
  49.     print "Mouse Type = ";
  50.     mt% = mousetype%
  51.     select case mt%
  52.       case = 1
  53.     print "  Bus Mouse"
  54.       case = 2
  55.     print "  Serial Mouse"
  56.       case = 3
  57.     print "  InPort Mouse"
  58.       case = 4
  59.     print "  PS/2 Mouse"
  60.       case = 5
  61.     print "  HP Mouse"
  62.     end select
  63. end select
  64.  
  65. call showmouse                ' display the mouse cursor
  66.  
  67. print
  68. print "Mouse is in page ";getmousepage%    ' tell what screen page mouse is in
  69. print
  70. input "Move mouse to what page ";mpg%    ' move the mouse to a new page
  71.  
  72. call setmousepage(mpg%)
  73.  
  74. print "Mouse is in page ";getmousepage%
  75.  
  76. screen ,,mpg%,mpg%                      ' change screen page to mouse page
  77.  
  78. call showmouse                ' display the mouse cursor
  79.  
  80. while inkey$ = null$            ' give info on where the mouse is
  81.   b& = wheremouse&
  82.   x& = (b& mod 65536)
  83.   y& = (b& / 65536)
  84.   locate 10,1
  85.   print using "Mouse is at ##### #####     Press any key to exit.";x&,y&
  86. wend
  87.  
  88. cls
  89.  
  90. while inkey$ = null$            ' tell user about mouse buttons
  91.   b% = mousebuttons%
  92.   locate 1,1
  93.   print "Mouse Buttons (Press any key to exit): ";
  94.   select case b%
  95.     case = 0
  96.       print "None                      "
  97.     case = 1
  98.       print "Left Button               "
  99.     case = 2
  100.       print "Right Button              "
  101.     case = 4
  102.       print "Middle Button             "
  103.     case = 3
  104.       print "Left and Right Buttons    "
  105.     case = 5
  106.       print "Left and Middle Buttons   "
  107.     case = 6
  108.       print "Right and Middle Buttons  "
  109.     case = 7
  110.       print "All Buttons               "
  111.   end select
  112. wend
  113.  
  114.