Bug fix
Fix pressing right and left key both triggers left button bug.
This commit is contained in:
parent
489d20e09b
commit
893c24cee1
1 changed files with 13 additions and 14 deletions
27
mcdu.html
27
mcdu.html
|
@ -50,8 +50,7 @@
|
||||||
tds = document.querySelectorAll('.enter td');
|
tds = document.querySelectorAll('.enter td');
|
||||||
for (const td of tds) {
|
for (const td of tds) {
|
||||||
td.addEventListener('click', function () {
|
td.addEventListener('click', function () {
|
||||||
press_button(td.nextSibling ? "lskbutton" : "rskbutton", td.getAttribute("button-id"));
|
press_button(td.getAttribute("button-side") == "l" ? "lskbutton" : "rskbutton", td.getAttribute("button-id"));
|
||||||
console.log(td.getAttribute("button-id"));
|
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
tds = document.querySelectorAll('.menu td');
|
tds = document.querySelectorAll('.menu td');
|
||||||
|
@ -157,28 +156,28 @@
|
||||||
<td><br></td>
|
<td><br></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td button-id="1">—</td>
|
<td button-id="1" button-side="l">—</td>
|
||||||
<td button-id="1">—</td>
|
<td button-id="1" button-side="r">—</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td button-id="2">—</td>
|
<td button-id="2" button-side="l">—</td>
|
||||||
<td button-id="2">—</td>
|
<td button-id="2" button-side="r">—</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td button-id="3">—</td>
|
<td button-id="3" button-side="l">—</td>
|
||||||
<td button-id="3">—</td>
|
<td button-id="3" button-side="r">—</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td button-id="4">—</td>
|
<td button-id="4" button-side="l">—</td>
|
||||||
<td button-id="4">—</td>
|
<td button-id="4" button-side="r">—</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td button-id="5">—</td>
|
<td button-id="5" button-side="l">—</td>
|
||||||
<td button-id="5">—</td>
|
<td button-id="5" button-side="r">—</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td button-id="6">—</td>
|
<td button-id="6" button-side="l">—</td>
|
||||||
<td button-id="6">—</td>
|
<td button-id="6" button-side="r">—</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><br></td>
|
<td><br></td>
|
||||||
|
|
Loading…
Add table
Reference in a new issue