Namespace sandboxe.input
Defined in: docbase.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Collection of functions and references to work with input form the system.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
sandboxe.input.buttonListener(Input)
Creates a new buttonListener object, which are used to call methods after certain inputs are detected.
|
<static> |
sandboxe.input.getLastUnicode()
Retrieves the last unicode value typed by a user keyboard if any.
|
<static> |
sandboxe.input.getState(Input)
Returns the active state of the input.
|
<static> |
sandboxe.input.isHeld(Input)
Returns whether the input is currently held.
|
<static> |
sandboxe.input.isPressed(Input)
Returns whether the input is currently pressed.
|
<static> |
sandboxe.input.isReleased(Input)
Returns whether the input was released.
|
<static> |
sandboxe.input.mapInput(Name, Input)
Maps an input value flag to a string, allowing for more convenient querying.
|
<static> |
sandboxe.input.mouseWheel()
Returns the mouse wheel's current state.
|
<static> |
sandboxe.input.mouseX()
Returns the X position of the pointer, if any.
|
<static> |
sandboxe.input.mouseXDelta()
Returns the X position change since last update frame.
|
<static> |
sandboxe.input.mouseY()
Returns the Y position of the pointer, if any.
|
<static> |
sandboxe.input.mouseYDelta()
Returns the Y position change since last update frame.
|
<static> |
sandboxe.input.unicodeListener()
Creates a new unicodeListener object, which are used to call methods after characters are typed by the user keyboard.
|
<static> |
sandboxe.input.unmapInput(MappedName)
Removes an input map by name.
|
Namespace Detail
sandboxe.input
Collection of functions and references to work with input form the system.
Method Detail
<static>
{buttonListener}
sandboxe.input.buttonListener(Input)
Creates a new buttonListener object, which are used to call methods after certain inputs are detected.
- Parameters:
- {Number|String} Input
- The input to detect. See sandboxe input flags.
- Returns:
- {buttonListener}
<static>
{Number}
sandboxe.input.getLastUnicode()
Retrieves the last unicode value typed by a user keyboard if any.
- Returns:
- {Number}
<static>
{Boolean}
sandboxe.input.getState(Input)
Returns the active state of the input. 0 is for inactive (not pressed)
1 is for active (pressed)
- Parameters:
- {Number|String} Input
- The type of input to query. See sandboxe input enumerator.
- Returns:
- {Boolean}
<static>
{Boolean}
sandboxe.input.isHeld(Input)
Returns whether the input is currently held. That is, in a pressed state for more that one frame continuously..
- Parameters:
- {Number|String} Input
- The type of input to query. See sandboxe input enumerator.
- Returns:
- {Boolean}
<static>
{Boolean}
sandboxe.input.isPressed(Input)
Returns whether the input is currently pressed.
- Parameters:
- {Number|String} Input
- The type of input to query. See sandboxe input enumerator.
- Returns:
- {Boolean}
<static>
{Boolean}
sandboxe.input.isReleased(Input)
Returns whether the input was released. That is, transitioned form a pressed state to an unpressed state this frame.
- Parameters:
- {Number|String} Input
- The type of input to query. See sandboxe input enumerator.
- Returns:
- {Boolean}
<static>
sandboxe.input.mapInput(Name, Input)
Maps an input value flag to a string, allowing for more convenient querying.
Once a mapping has taken place, any place an input enumerator value is accepted, a string can be
accepted in its place.
- Parameters:
- {String} Name
- {Number} Input
- Value to map to. See sandboxe input enumerator.
<static>
{Number}
sandboxe.input.mouseWheel()
Returns the mouse wheel's current state. 0 is for "neutral",
-1 is for down, and 1 is for up.
- Returns:
- {Number}
<static>
{Number}
sandboxe.input.mouseX()
Returns the X position of the pointer, if any.
- Returns:
- {Number} X position of the pointer.
<static>
{Number}
sandboxe.input.mouseXDelta()
Returns the X position change since last update frame.
- Returns:
- {Number}
<static>
{Number}
sandboxe.input.mouseY()
Returns the Y position of the pointer, if any.
- Returns:
- {Number} Y position of the pointer.
<static>
{Number}
sandboxe.input.mouseYDelta()
Returns the Y position change since last update frame.
- Returns:
- {Number}
<static>
{unicodeListener}
sandboxe.input.unicodeListener()
Creates a new unicodeListener object, which are used to call methods after characters are typed by the user keyboard.
- Returns:
- {unicodeListener}
<static>
sandboxe.input.unmapInput(MappedName)
Removes an input map by name.
- Parameters:
- {String} MappedName