From 26fac96b143bec3601589fb0bdb4ca9dca72cce9 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 11 Feb 2026 20:41:29 -0600 Subject: [PATCH] Refactor input handlings slightly --- src/App.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ea05577..6df9d86 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -99,16 +99,12 @@ function App() { // Handle keyboard/scanner input useEffect(() => { const handleKeyDown = (ev: KeyboardEvent) => { - if (ev.key === "s") { // TODO: remove - ev.preventDefault(); - lookupBarcode("075021370814"); - return; - } else if (ev.key === "d") { - ev.preventDefault(); - lookupBarcode("015775150522"); - return + ev.preventDefault(); + if (ev.key === "F1") { // TODO: remove + lookupBarcode("075021370814"); // Breakfast in America; owned + } else if (ev.key === "F2") { + lookupBarcode("015775150522"); // Crime of the Century; not owned } else if (ev.key === "Enter") { - ev.preventDefault(); const code = buffer.join("").trim(); setBuffer([]); // Reset the buffer lookupBarcode(code);