0.0.6 • Published 10 years ago

mantle v0.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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.

0.0.6

10 years ago

0.0.4

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago