# Class: input

Luxinia's function publishing does not offer direct calling of external functions if an event arises, such as key or mouseinputs. Instead, Luxinia saves event occurances in queues that can be processed when the scripting language is running.

## Methods:

### Method overview:

- escquit
- isKeyDown
- isMouseDown
- joystick
- mousePos
- mouseWheel
- popKey
- popMouse
- showmouse

escquit ([boolean on])
  returns: ([boolean on])
  sets or gets quit when esc is pressed
isKeyDown (int keycode)
  returns: (boolean isDown)
  returns true if the key is pressed.
isMouseDown (int mousebutton)
  returns: (boolean isDown)
  returns true if the mousebutton is currently hold down. The mousebutton must be >=0 and <3 where 0 is the left, 1 the right and 2 the middle mousebutton.
joystick ([int nr])
  returns: (boolean exists,[int joysticknr,int axiscount,int btncnt, float pos1,..., boolean btn1,...])
  returns joystick position and currently pressed buttons or false, if the given number does not exist. If no number is passed, joystick 0 is used. nr must be smaller than 16 and >= 0. Luxinia limits the number of axis to 8 and the number of buttons to 32, which should be enough.
mousePos ([float x,y])
  returns: ([float x,y])
  sets or gets mouseposition
mouseWheel ([int])
  returns: ([int])
  sets or gets mousewheelposition
popKey ()
  returns: ([int key, int keycode, boolean isDown])
  pops a key from keyhistoryqueue. The key is the resulted char of the keyboard. The keycode is the number on the keyboard, which doesn't have to be a printable letter. In case of unprintable letters, key is 0.
popMouse ()
  returns: ([float x,y, int button, boolean isDown])
  pops a mouseevent from queue
showmouse (boolean visible)
  returns: ()
  sets mouse visibility. Only if the mouse is visible, it can be moved out from the window. The invisible mouse may have coordinates that are outside the window. Initially, the mouse is invisible. If the console is activated and deactivated, the visibilitystatus is set to invisible again.