0.0.6 • Published 11 years ago
mantle v0.0.6
Mantle
This module contains methods for interacting with the host window. It is an instance of EventEmitter.
Use require('mantle')to use this module. The following methods are provided:
Event: keyDown
keyNumber The key that was pressed.repeatBoolean True/false indicating if this key is a repeat key.modifiersObject The input modifiers that are currently active.
This event is emitted when the user presses a key.
Event: keyUp
keyNumber The key that was released.repeatBoolean True/false indicating if this key is a repeat key.modifiersObject The input modifiers that are currently active.
This event is emitted when a key that has been pressed is released.
Event: mouseDown
xNumber The x coordinate, in relative screen space.yNumber The y coordinate, in relative screen space.buttonNumber The button that was pressed.modifiersObject The input modifiers that are currently active.
This event is emitted when the user presses a mouse button.
Event: mouseUp
xNumber The x coordinate, in relative screen space.yNumber The y coordinate, in relative screen space.buttonNumber The button that was released.modifiersObject The input modifiers that are currently active.
This event is emitted when a mouse button that has been pressed is released.
Event: mouseMove
xNumber The x coordinate, in relative screen space.yNumber The y coordinate, in relative screen space.buttonsNumber A bitmask of buttons currently being held down.modifiersObject The input modifiers that are currently active.
This event is emitted when the user moves the mouse pointer by 1 pixel or more in any direction in the mantle.
mantle.setRedraw(callback)
callback(timestamp)Function The function to call at the next redraw.
Schedules the given callback to be called at the next redraw.
mantle.clearRedraw(redrawObject)
redrawObjectObject The redraw to stop from triggering.
Stops a redraw from triggering.