summaryrefslogtreecommitdiff
path: root/examples/emscripten-example-js-library.js
blob: fbb3f5e1d7a6f71e36cf8c28c9f7ce6e366d6bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//"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);