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

Method updateGamepadLabels

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

Source from the content-addressed store, hash-verified

1174 }
1175 }
1176 updateGamepadLabels() {
1177 for (let i = 0; i < this.gamepadLabels.length; i++) {
1178 this.gamepadLabels[i].innerHTML = ""
1179 const def = this.createElement("option");
1180 def.setAttribute("value", "notconnected");
1181 def.innerText = "Not Connected";
1182 this.gamepadLabels[i].appendChild(def);
1183 for (let j = 0; j < this.gamepad.gamepads.length; j++) {
1184 const opt = this.createElement("option");
1185 opt.setAttribute("value", this.gamepad.gamepads[j].id + "_" + this.gamepad.gamepads[j].index);
1186 opt.innerText = this.gamepad.gamepads[j].id + "_" + this.gamepad.gamepads[j].index;
1187 this.gamepadLabels[i].appendChild(opt);
1188 }
1189 this.gamepadLabels[i].value = this.gamepadSelection[i] || "notconnected";
1190 }
1191 }
1192 createLink(elem, link, text, useP) {
1193 const elm = this.createElement("a");
1194 elm.href = link;

Callers 3

startGameMethod · 0.95
bindListenersMethod · 0.95

Calls 1

createElementMethod · 0.95

Tested by

no test coverage detected