# Class: MouseCursor

### LuxModule: gui

The mousecursor is a visual representation of the mouse. The graphical appearance can be customized.

## Methods:

### Method overview:

- addMouseListener
- enable
- mouseL2D
- pos
- prevpos
- removeMouseListener
- showMouse
- wasButtonPressed

addMouseListener (MouseListener ml)
  returns: ()
  adds a mouselistener which will be called if the eventmask fits the mouselistener's eventmask.
enable ([boolean enable])
  returns: ([boolean enabled])
  enables or disables or returns current state of mousecursor. Only a enabled mouse produces clickevents and movementevents. If the mousecursor of the operating system is not shown (see MouseCursor.showMouse), a custom mousecursor is shown instead.
mouseL2D ([l2dnode],[hotspotx,hotspoty])
  returns: (l2dnode)
  returns the l2d that is used as mousecursor. If a l2dnode is passed as argument, the current mousecursor is replaced by the argument and the old l2dnode is returned. This might be the defaultmousecursor.
pos ([int x,y])
  returns: ([int x,y],[boolean nomove])

  returns or sets current mouse cursor position. Generates a mouseevent that is delegated to the mousecursor's mouselistener list. If nomove is true, input.mousepos(x,y) is NOT called, leaving the OS cursor where it is.

prevpos ()
  returns: (int x,y)
  Mouseposition in previous frame
removeMouseListener (MouseListener ml)
  returns: ()
  removes a mouselistener
showMouse ([boolean])
  returns: ([boolean])
  same as input.showMouse. If the mouse is visible, MouseCursor.enable will be true.
wasButtonPressed (int button)
  returns: (boolean)
  returns true if the button (0-2) was pressed during the last frame