From aad5243bb13f4aabdf5cf956d601bdfac8196cdd Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 28 Aug 2023 15:00:18 -0400 Subject: [PATCH] ignore alt and ctrl in hotkey --- views/honkpage.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/views/honkpage.js b/views/honkpage.js index 9f198a3..c3e3e63 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -440,9 +440,11 @@ function scrollprevioushonk() { } } -document.addEventListener("keydown", function(e) { +function hotkey(e) { if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) - return; + return + if (e.ctrlKey || e.altKey) + return switch (e.code) { case "KeyR": @@ -463,7 +465,9 @@ document.addEventListener("keydown", function(e) { e.preventDefault() break } -}) +} + +document.addEventListener("keydown", hotkey) function addemu(elem) { const data = elem.alt