mantle

0.0.6 • Public • Published

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.
  • repeat Boolean True/false indicating if this key is a repeat key.
  • modifiers Object 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.
  • repeat Boolean True/false indicating if this key is a repeat key.
  • modifiers Object The input modifiers that are currently active.

This event is emitted when a key that has been pressed is released.

Event: mouseDown

  • x Number The x coordinate, in relative screen space.
  • y Number The y coordinate, in relative screen space.
  • button Number The button that was pressed.
  • modifiers Object The input modifiers that are currently active.

This event is emitted when the user presses a mouse button.

Event: mouseUp

  • x Number The x coordinate, in relative screen space.
  • y Number The y coordinate, in relative screen space.
  • button Number The button that was released.
  • modifiers Object The input modifiers that are currently active.

This event is emitted when a mouse button that has been pressed is released.

Event: mouseMove

  • x Number The x coordinate, in relative screen space.
  • y Number The y coordinate, in relative screen space.
  • buttons Number A bitmask of buttons currently being held down.
  • modifiers Object 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)

  • redrawObject Object The redraw to stop from triggering.

Stops a redraw from triggering.

Readme

Keywords

Package Sidebar

Install

npm i mantle

Weekly Downloads

0

Version

0.0.6

License

MIT

Last publish

Collaborators

  • caspervonb