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

Method keyLookup

data/src/emulator.js:3313–3323  ·  view source on GitHub ↗
(controllerkey)

Source from the content-addressed store, hash-verified

3311 }
3312 }
3313 keyLookup(controllerkey) {
3314 if (controllerkey === undefined) return 0;
3315 if (typeof controllerkey === "number") return controllerkey;
3316 controllerkey = controllerkey.toString().toLowerCase()
3317 const values = Object.values(this.keyMap);
3318 if (values.includes(controllerkey)) {
3319 const index = values.indexOf(controllerkey);
3320 return Object.keys(this.keyMap)[index];
3321 }
3322 return -1;
3323 }
3324 keyChange(e) {
3325 if (e.repeat) return;
3326 if (!this.started) return;

Callers 1

setupKeysMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected