Skip to content

Commit

Permalink
Fix being able to press the same key multiple times | Doesn't include…
Browse files Browse the repository at this point in the history
… numbers
  • Loading branch information
DodoSeal committed Mar 13, 2024
1 parent 41ad9b3 commit 8b204e8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ for (let key of keypad) {
key.addEventListener('click', (event) => {
switch(key.getAttribute('value')) {
case "Release All":
if (lastKey == "Release All") return;

sendDMX({});
cmdBar.value = "Release All*";
break;
case "+":
if (cmdBar.value == "" || lastKey == "Thru" || lastKey == "At" || lastKey == "Full" || cmdBar.value.includes("@")) return;
if (cmdBar.value == "" || lastKey == "Thru" || lastKey == "+" || lastKey == "At" || lastKey == "Full" || cmdBar.value.includes("@")) return;

cmdBar.value += " + ";
lastKey = key.value;
Expand All @@ -104,7 +106,7 @@ for (let key of keypad) {
cmdBar.value = "";
break;
case "Enter":
if (cmdBar.value == "" || lastKey == "+" || lastKey == "At" || lastKey == "Thru" || lastKey == "Full") return;
if (cmdBar.value == "" || lastKey == "+" || lastKey == "At" || lastKey == "Thru" || lastKey == "Full" || lastKey == "Enter") return;

parse(cmdBar.value);

Expand All @@ -113,13 +115,13 @@ for (let key of keypad) {
payload = {};
break;
case "At":
if (cmdBar.value == "" || lastKey == "+" || lastKey == "Thru" || lastKey == "Full") return;
if (cmdBar.value == "" || lastKey == "+" || lastKey == "Thru" || lastKey == "Full" || lastKey == "At") return;

cmdBar.value += " @ ";
lastKey = key.value;
break;
case "Thru":
if (cmdBar.value == "" || lastKey == "+" || lastKey == "At" || lastKey == "Full") return;
if (cmdBar.value == "" || lastKey == "+" || lastKey == "At" || lastKey == "Full" || lastKey == "Thru") return;

cmdBar.value += " Thru ";
lastKey = key.value;
Expand Down

0 comments on commit 8b204e8

Please sign in to comment.