ig.

Input

new Input()

Improvements and expansion of default Input to include multi touch and gestures.
- 1. instead of using ig.input.mouse, use ig.Input#inputPoints, ig.Input#getInputPoint, or ig.Input#getInputPoints
- good news everybody, ig.input.mouse is still updated for backwards compatibility Tip: mouse and touches are both treated as input points so you can use them the same way anywhere.

Author:
  • Collin Hover - collinhover.com
Source:

inputPoints :Array

List of all active inputPoints.

Source:
See:

getInputPoint(parameters) → {Object}

Finds an inputPoint based on search parameters.

Parameters:
Name Type Argument Description
parameters String | Object <optional>
a string, or an object with identifier property.
Source:
Returns:
{ Object } a inputPoint.

getInputPointId(parameters) → {String}

Finds an inputPoint id based on search parameters.

Parameters:
Name Type Argument Description
parameters String | Object <optional>
a string, or an object with identifier property.
Source:
Returns:
{ String } id.

getInputPoints(properties, values) → {Array}

Finds all inputPoints based on properties and values.

Parameters:
Name Type Description
properties Array array of property names.
values Array array of property values.
Source:
Returns:
{ Array } list of input points that match.

initMouse()

Initializes mouse and touch.

Source:
See:

inputPointMove(event, scale, boundsClient)

Repositions a inputPoint based on event, scale, and optionally, bounds.

Parameters:
Name Type Argument Description
event Event event object.
scale Number scale to modify event position with.
boundsClient Object <optional>
bounding client rect of canvas.
Source:

inputPressed(code)

Flags that an input has been pressed.

Parameters:
Name Type Description
code String input code.
Source:
See:
  • ig.KEY

inputReleased(code)

Flags that an input has been released.

Parameters:
Name Type Description
code String input code.
Source:
See:
  • ig.KEY

keycancel(event)

Cancels an input event.

Parameters:
Name Type Description
event Event
Source:

keydown()

Listener for when a key, mouse button, or touch is down.

Parameters:
Name Type Description
event. Event
Source:
See:

keyup()

Listener for when a key, mouse button, or touch is up.

Parameters:
Name Type Description
event. Event
Source:
See:

mousemove(event)

Repositions inputPoints based on event.

Parameters:
Name Type Description
event Event
Source:

removeInputPoint(parameters)

Removes an inputPoint from inputPoints based on search parameters.

Parameters:
Name Type Argument Description
parameters String | Object <optional>
a string, or an object with identifier property.
Source:

update()

Updates each input point to keep timed interactions accurate ( such as hold ).

Source: