# Class: MouseListener

### LuxModule: gui

A mouselistener reacts on certain type of events and call a eventfunction.

## Methods:

### Method overview:

- 1
- 2
- eventcall
- matches
- new
- onClicked
- onDragged
- onEnter
- onExit
- onMoved
- onPressed
- onReleased
- onWheel

new (function callback, [int eventFilter])
  returns: (MouseListener)

  creates a new MouseListener. The eventFilter is optional and can be created by creating the product of the specific events of interest (i.e. MouseEvent.MOUSE_MOVED*MouseEvent.MOUSE_CLICKED). If eventFilter is not given, the listenerfunction will be called on every mouseevent.

  The callback function's signature is

       function listener (mouselistener, mouseevent)

1
  {[function]} - listener function
2
  {[int]} - eventmask
eventcall (MouseListener self, MouseEvent e)
  returns: (boolean)
  same as MouseListener.matches, but calls the listener's function instantly.
matches (MouseListener self, MouseEvent e)
  returns: (boolean)
  returns true if the mouselistener's eventmask matches the eventmask of the MouseEvent.
onClicked
  {[boolean]} - true if the mouselistener reacts on clicks
onDragged
  {[boolean]} - true if the mouselistener reacts on dragging
onEnter
  {[boolean]} - true if the mouselistener reacts on enterings
onExit
  {[boolean]} - true if the mouselistener reacts on mouseexists
onMoved
  {[boolean]} - true if the mouselistener reacts on moves
onPressed
  {[boolean]} - true if the mouselistener reacts on presses
onReleased
  {[boolean]} - true if the mouselistener reacts on releases
onWheel
  {[boolean]} - true if the mouselistener reacts on wheelmoves