This page is work-in-progress. You can reach me on twitter or mail to rezoner1337@gmail.com

Mouse

I recommend using Pointer rather than mouse.

playground({

  mousemove: function(event) {

    event.x         /* mouseX */
    event.y         /* mouseY */
    event.original  /* original DOM event */

  },

  mousedown: function(event) {

    event.x         /* mouseX */
    event.y         /* mouseY */
    event.button    /* button "left", "right", "middle" */
    event.original  /* original DOM event */

  },

  mouseup: function(event) {

    event.x         /* mouseX */
    event.y         /* mouseY */
    event.button    /* button "left", "right", "middle" */
    event.original  /* original DOM event */

  },

  mousewheel: function(event) {

    event.x         /* mouseX */
    event.y         /* mouseY */
    event.delta     /* -1 or 1 */
    event.original  /* original DOM event */

  }

});

You also have access to this.mouse which holds current mouse status.

this.mouse.x
this.mouse.y
this.mouse.left
this.mouse.middle
this.mouse.right

Ask question:

Fork me on GitHub