1
0
mirror of https://github.com/brl/mutter.git synced 2025-03-21 10:43:53 +00:00
mutter/examples/emscripten-example-js-library.js

20 lines
514 B
JavaScript
Raw Normal View History

//"use strict";
var LibraryEXAMPLE = {
$EXAMPLE__deps: ['$Browser'],
$EXAMPLE: {
receiveEvent: function(event) {
Browser.mainLoop.resume();
},
},
example_js_add_input_listener: function() {
['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll',
'mousewheel', 'mouseout'].forEach(function(event) {
Module['canvas'].addEventListener(event, EXAMPLE.receiveEvent, true);
});
}
};
autoAddDeps(LibraryEXAMPLE, '$EXAMPLE');
mergeInto(LibraryManager.library, LibraryEXAMPLE);