From c5f49811888d5d4d6744ba3eb4d07cc4fd71afeb Mon Sep 17 00:00:00 2001
From: Stephen D <webmaster@scd31.com>
Date: Sun, 16 Mar 2025 13:29:55 -0400
Subject: [PATCH] weeeeeeeee

---
 app.js                      | 41 ++++++++++++++++++++++++++++++++-----
 jsQR/dist/jsQR.js           |  6 +++---
 jsQR/docs/jsQR.js           |  6 +++---
 jsQR/src/decoder/decoder.ts |  4 ++--
 4 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/app.js b/app.js
index 51aa8af..15a7c00 100644
--- a/app.js
+++ b/app.js
@@ -216,14 +216,45 @@ function tick() {
 
     latencyDiv.innerText = `Frame latency: ${delta}ms`;
 
-    // reset
-    qr = {};
-
     if (code?.data.length > 0) {
+      // reset
+      qr = {
+        //a: qr.a, // don't reset a!
+      };
+
       latencyScan.innerText = `Scan latency: ${delta}ms`;
 
-      // TODO Spencer
-      if (code.data == "ABCDEFGHIJKLNOPQRSTUVWXYZ") {
+      // Left
+      if (code.data.includes("OP3%S") || code.data.includes("OP9OS")) {
+        qr.left = true;
+      }
+
+      // Right
+      if (
+        code.data.includes("OO$:S") ||
+        code.data.includes("OPJMS") ||
+        code.data.includes("OOZ6S") ||
+        code.data.includes("OPZ6S") ||
+        code.data.includes("OPCHS") ||
+        code.data.includes("OPD S") ||
+        code.data.includes("OOD S") ||
+        code.data.includes("OPGTS") ||
+        code.data.includes("OO PS") ||
+        code.data.includes("OOP8S")
+      ) {
+        qr.right = true;
+      }
+
+      // A button
+      if (code.data.startsWith("ARC")) {
+        qr.a = false;
+      } else if (
+        code.data.startsWith("A7H") ||
+        code.data.startsWith("ANH") ||
+        code.data.startsWith("A8+") ||
+        code.data.startsWith("A8H") ||
+        code.data.startsWith("A9H")
+      ) {
         qr.a = true;
       }
 
diff --git a/jsQR/dist/jsQR.js b/jsQR/dist/jsQR.js
index 1b242c2..f83e48d 100644
--- a/jsQR/dist/jsQR.js
+++ b/jsQR/dist/jsQR.js
@@ -575,9 +575,9 @@ function decodeMatrix(matrix) {
         if (!correctedBytes) {
           return null;
           }*/
-        if (resultIndex == 0) {
-            console.log(dataBlock.codewords[0]);
-        }
+        /*if(resultIndex == 0) {
+          console.log(dataBlock.codewords[0]);
+          }*/
         for (var i = 0; i < dataBlock.numDataCodewords; i++) {
             resultBytes[resultIndex++] = dataBlock.codewords[i];
         }
diff --git a/jsQR/docs/jsQR.js b/jsQR/docs/jsQR.js
index 1b242c2..f83e48d 100644
--- a/jsQR/docs/jsQR.js
+++ b/jsQR/docs/jsQR.js
@@ -575,9 +575,9 @@ function decodeMatrix(matrix) {
         if (!correctedBytes) {
           return null;
           }*/
-        if (resultIndex == 0) {
-            console.log(dataBlock.codewords[0]);
-        }
+        /*if(resultIndex == 0) {
+          console.log(dataBlock.codewords[0]);
+          }*/
         for (var i = 0; i < dataBlock.numDataCodewords; i++) {
             resultBytes[resultIndex++] = dataBlock.codewords[i];
         }
diff --git a/jsQR/src/decoder/decoder.ts b/jsQR/src/decoder/decoder.ts
index 350c548..32fc531 100644
--- a/jsQR/src/decoder/decoder.ts
+++ b/jsQR/src/decoder/decoder.ts
@@ -313,9 +313,9 @@ function decodeMatrix(matrix: BitMatrix) {
       return null;
       }*/
 
-    if(resultIndex == 0) {
+    /*if(resultIndex == 0) {
       console.log(dataBlock.codewords[0]);
-    }
+      }*/
     
     for (let i = 0; i < dataBlock.numDataCodewords; i++) {
       resultBytes[resultIndex++] = dataBlock.codewords[i];
-- 
GitLab