MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / setupKeys

Method setupKeys

data/src/emulator.js:3300–3312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3298 }
3299 }
3300 setupKeys() {
3301 for (let i = 0; i < 4; i++) {
3302 for (let j = 0; j < 30; j++) {
3303 if (this.controls[i][j]) {
3304 this.controls[i][j].value = parseInt(this.keyLookup(this.controls[i][j].value));
3305 if (this.controls[i][j].value === -1 && this.debug) {
3306 delete this.controls[i][j].value;
3307 console.warn("Invalid key for control " + j + " player " + i);
3308 }
3309 }
3310 }
3311 }
3312 }
3313 keyLookup(controllerkey) {
3314 if (controllerkey === undefined) return 0;
3315 if (typeof controllerkey === "number") return controllerkey;

Callers 1

Calls 1

keyLookupMethod · 0.95

Tested by

no test coverage detected