home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / euphor10.zip / MOUSE.E < prev    next >
Text File  |  1993-06-21  |  781b  |  30 lines

  1.         --------------------
  2.         -- Mouse Routines --
  3.         --------------------
  4.  
  5. -- Mouse Event Numbers:
  6. global constant MOVE = 1,    -- track every movement of the mouse
  7.         LEFT_DOWN = 2,  -- the rest are button pressing/releasing
  8.         LEFT_UP = 4,
  9.         RIGHT_DOWN = 8,
  10.         RIGHT_UP = 16,
  11.         MIDDLE_DOWN = 32,
  12.         MIDDLE_UP = 64
  13.  
  14. constant GET_MOUSE = 14,
  15.      MOUSE_EVENTS = 15
  16.  
  17. global function get_mouse()
  18. -- report mouse events,
  19. -- returns -1 if no mouse event, 
  20. -- otherwise returns {event#, x-coord, y-coord}
  21.     return machine_func(GET_MOUSE, 0)   
  22. end function
  23.  
  24. global procedure mouse_events(integer events)
  25. -- select the mouse events to be reported by get_mouse()
  26. -- e.g. mouse_events(LEFT_UP + LEFT_DOWN + RIGHT_DOWN)
  27.     machine_proc(MOUSE_EVENTS, events)
  28. end procedure
  29.  
  30.