home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / euphoria / mouse.e < prev    next >
Text File  |  1994-01-31  |  963b  |  36 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 M_GET_MOUSE = 14,
  15.      M_MOUSE_EVENTS = 15,
  16.      M_MOUSE_POINTER = 24
  17.  
  18. global function get_mouse()
  19. -- report mouse events,
  20. -- returns -1 if no mouse event,
  21. -- otherwise returns {event#, x-coord, y-coord}
  22.     return machine_func(M_GET_MOUSE, 0)
  23. end function
  24.  
  25. global procedure mouse_events(integer events)
  26. -- select the mouse events to be reported by get_mouse()
  27. -- e.g. mouse_events(LEFT_UP + LEFT_DOWN + RIGHT_DOWN)
  28.     machine_proc(M_MOUSE_EVENTS, events)
  29. end procedure
  30.  
  31. global procedure mouse_pointer(integer show_it)
  32. -- show (1) or hide (0) the mouse pointer
  33.     machine_proc(M_MOUSE_POINTER, show_it)
  34. end procedure
  35.  
  36.