Temporarily capture all mouse events
Temporarily capture all mouse events, preventing them from reaching underlying elements.
Browserify is recommended.
$ npm install rattrap
rattrap expects the
document object to be globally accessible.
var rt = require'rattrap';vat stopCapture = rtstartCaptureconsole.log"captured mouse movement" evt;stopCapture;;
Starts catpuring all mouse events and dispatches them to
handlers, an object mapping DOM event names such as
mouseup to event handlers. The special key
cursor can also be used to display any CSS-supported cursor whilst capture is active. If omitted,
document defaults to
window.document. Returns a function that can be called to cancel the capture operation.
Tested on Chrome 28 and Firefox 22.