BB.MouseInput

A module for standardizing mouse events from an HTML5 canvas so that they may be used with the event funnel suite of modules.

Note: For use with HTML5 canvas only.

Constructor

BB.MouseInput
(
  • canvasElement
)

Parameters:

  • canvasElement HTMLCanvasElement

    The HTML5 canvas object listening for mouse input.

Properties

canvasElem Object

The HTML5 canvas element passed into BB.MouseInput during construction.

clickX Number default:0

The last clicked x position.

clickY Number default:0

The last clicked y position.

isDown Boolean default:false

Holds wether or not the left mouse button is currently depressed. This property is read-only.

isMoving Boolean default:false

Holds wether or not the mouse is currently moving. This property is read-only.

LEFT_BUTTON Number static default:0

Utility property that hold's the value of a JavaScript MouseEvent's left mouse button.

moveDebounce Number default:150

Time in milliseconds that the mouse has been still before its movement is considering to be finished.

RIGHT_BUTTON Number static default:2

Utility property that hold's the value of a JavaScript MouseEvent's right mouse button.

SCROLL_BUTTON Number static default:1

Utility property that hold's the value of a JavaScript MouseEvent's scroll wheel button.

x Number default:0

The current x position.

y Number default:0

The current y position.

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index