MCPcopy
hub / github.com/gabrielecirulli/2048 / KeyboardInputManager

Function KeyboardInputManager

js/keyboard_input_manager.js:1–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1function KeyboardInputManager() {
2 this.events = {};
3
4 if (window.navigator.msPointerEnabled) {
5 //Internet Explorer 10 style
6 this.eventTouchstart = "MSPointerDown";
7 this.eventTouchmove = "MSPointerMove";
8 this.eventTouchend = "MSPointerUp";
9 } else {
10 this.eventTouchstart = "touchstart";
11 this.eventTouchmove = "touchmove";
12 this.eventTouchend = "touchend";
13 }
14
15 this.listen();
16}
17
18KeyboardInputManager.prototype.on = function (event, callback) {
19 if (!this.events[event]) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected