Lysa  0.0
Lysa 3D Engine
Input Class Referenceabstract

Detailed Description

Static input polling utilities.

Lua full name: lysa.Input

Public Member Functions

boolean is_key_pressed (key: integer)static
 Returns true while the given key is held down. More...
 
boolean is_key_just_pressed (key: integer)static
 Returns true only on the first frame the key was pressed. More...
 
boolean is_key_just_released (key: integer)static
 Returns true only on the first frame the key was released. More...
 
float2 get_keyboard_vector (negX: integer, posX: integer, negY: integer, posY: integer)static
 Builds a 2-D movement vector from four keys (e.g. WASD). More...
 
boolean is_mouse_button_pressed (button: integer)static
 Returns true while the given mouse button is held down. More...
 
boolean is_mouse_button_just_pressed (button: integer)static
 Returns true only on the first frame the mouse button was pressed. More...
 
boolean is_mouse_button_just_released (button: integer)static
 Returns true only on the first frame the mouse button was released. More...
 
integer get_connected_joypads ()static
 Returns the number of connected joypads/gamepads. More...
 
boolean is_gamepad (index: integer)static
 Returns true if the joypad at the given index is a gamepad. More...
 
string get_joypad_name (index: integer)static
 Returns the name string of the joypad at the given index. More...
 
float2 get_gamepad_vector (index: integer, axis: integer)static
 Returns a 2-D vector from a gamepad joystick axis. More...
 
boolean is_gamepad_button_pressed (index: integer, button: integer)static
 Returns true while the given gamepad button is held down. More...
 
boolean is_gamepad_button_just_released (button: integer)static
 Returns true only on the first frame the gamepad button was released. More...
 
boolean is_gamepad_button_just_pressed (button: integer)static
 Returns true only on the first frame the gamepad button was pressed. More...
 
boolean add_action (action: InputAction)static
 Registers a named input action; returns true on success. More...
 
boolean is_action (name: string, event: InputEvent)static
 Returns true if the given event matches the named action. More...
 

Member Function Documentation

boolean is_key_pressed ( integer  key)
static

Returns true while the given key is held down.

Parameters
keyinteger
Returns
boolean
boolean is_key_just_pressed ( integer  key)
static

Returns true only on the first frame the key was pressed.

Parameters
keyinteger
Returns
boolean
boolean is_key_just_released ( integer  key)
static

Returns true only on the first frame the key was released.

Parameters
keyinteger
Returns
boolean
float2 get_keyboard_vector ( integer  negX,
integer  posX,
integer  negY,
integer  posY)
static

Builds a 2-D movement vector from four keys (e.g. WASD).

Parameters
negXinteger
posXinteger
negYinteger
posYinteger
Returns
float2
boolean is_mouse_button_pressed ( integer  button)
static

Returns true while the given mouse button is held down.

Parameters
buttoninteger
Returns
boolean
boolean is_mouse_button_just_pressed ( integer  button)
static

Returns true only on the first frame the mouse button was pressed.

Parameters
buttoninteger
Returns
boolean
boolean is_mouse_button_just_released ( integer  button)
static

Returns true only on the first frame the mouse button was released.

Parameters
buttoninteger
Returns
boolean
integer get_connected_joypads ( )
static

Returns the number of connected joypads/gamepads.

Returns
integer
boolean is_gamepad ( integer  index)
static

Returns true if the joypad at the given index is a gamepad.

Parameters
indexinteger
Returns
boolean
string get_joypad_name ( integer  index)
static

Returns the name string of the joypad at the given index.

Parameters
indexinteger
Returns
string
float2 get_gamepad_vector ( integer  index,
integer  axis)
static

Returns a 2-D vector from a gamepad joystick axis.

Parameters
indexinteger
axisinteger
Returns
float2
boolean is_gamepad_button_pressed ( integer  index,
integer  button)
static

Returns true while the given gamepad button is held down.

Parameters
indexinteger
buttoninteger
Returns
boolean
boolean is_gamepad_button_just_released ( integer  button)
static

Returns true only on the first frame the gamepad button was released.

Parameters
buttoninteger
Returns
boolean
boolean is_gamepad_button_just_pressed ( integer  button)
static

Returns true only on the first frame the gamepad button was pressed.

Parameters
buttoninteger
Returns
boolean
boolean add_action ( InputAction  action)
static

Registers a named input action; returns true on success.

Parameters
actionInputAction
Returns
boolean
boolean is_action ( string  name,
InputEvent  event)
static

Returns true if the given event matches the named action.

Parameters
namestring
eventInputEvent
Returns
boolean