From 55829a38383b28f02ae2d20beb135fff6dd0cbe9 Mon Sep 17 00:00:00 2001 From: G-Fourteen Date: Thu, 11 Sep 2025 11:55:26 -0600 Subject: [PATCH] Remove all keyboard shortcuts --- chat-init.js | 20 +++++++------------- chat-storage.js | 26 ++++++++++---------------- screensaver.js | 36 ++++++++++-------------------------- simple.js | 25 +++++++++---------------- 4 files changed, 36 insertions(+), 71 deletions(-) diff --git a/chat-init.js b/chat-init.js index 928b3a1..afe331d 100644 --- a/chat-init.js +++ b/chat-init.js @@ -565,19 +565,13 @@ document.addEventListener("DOMContentLoaded", () => { chatInput.disabled = true; }; window._chatInternals.handleSendMessage = handleSendMessage; - chatInput.addEventListener("input", () => { - sendButton.disabled = chatInput.value.trim() === ""; - chatInput.style.height = "auto"; - chatInput.style.height = chatInput.scrollHeight + "px"; - }); - chatInput.addEventListener("keydown", e => { - if (e.key === "Enter" && !e.shiftKey) { - e.preventDefault(); - handleSendMessage(); - } - }); - sendButton.addEventListener("click", handleSendMessage); - sendButton.disabled = chatInput.value.trim() === ""; + chatInput.addEventListener("input", () => { + sendButton.disabled = chatInput.value.trim() === ""; + chatInput.style.height = "auto"; + chatInput.style.height = chatInput.scrollHeight + "px"; + }); + sendButton.addEventListener("click", handleSendMessage); + sendButton.disabled = chatInput.value.trim() === ""; chatInput.dispatchEvent(new Event("input")); const initialSession = Storage.getCurrentSession(); if (initialSession.messages?.length > 0) renderStoredMessages(initialSession.messages); diff --git a/chat-storage.js b/chat-storage.js index 77d43b2..e76fb78 100644 --- a/chat-storage.js +++ b/chat-storage.js @@ -591,22 +591,16 @@ document.addEventListener("DOMContentLoaded", () => { sendButton.disabled = true; chatInput.disabled = true; } - chatInput.addEventListener("input", () => { - sendButton.disabled = chatInput.value.trim() === ""; - chatInput.style.height = "auto"; - chatInput.style.height = chatInput.scrollHeight + "px"; - }); - chatInput.addEventListener("keydown", (e) => { - if (e.key === "Enter" && !e.shiftKey) { - e.preventDefault(); - handleSendMessage(); - } - }); - sendButton.addEventListener("click", () => { - handleSendMessage(); - }); - sendButton.disabled = chatInput.value.trim() === ""; - const initialSession = Storage.getCurrentSession(); + chatInput.addEventListener("input", () => { + sendButton.disabled = chatInput.value.trim() === ""; + chatInput.style.height = "auto"; + chatInput.style.height = chatInput.scrollHeight + "px"; + }); + sendButton.addEventListener("click", () => { + handleSendMessage(); + }); + sendButton.disabled = chatInput.value.trim() === ""; + const initialSession = Storage.getCurrentSession(); if (initialSession.messages && initialSession.messages.length > 0) { renderStoredMessages(initialSession.messages); } else { diff --git a/screensaver.js b/screensaver.js index 8fb5296..12c0cdb 100644 --- a/screensaver.js +++ b/screensaver.js @@ -683,32 +683,16 @@ document.addEventListener("DOMContentLoaded", () => { else window.showToast("Start the screensaver first!"); }); - hideButton.addEventListener("click", (e) => { - e.stopPropagation(); - if (screensaverActive) toggleControls(); - else window.showToast("Start the screensaver first!"); - }); - - document.addEventListener('keydown', (e) => { - if (!screensaverActive) return; - switch (e.key) { - case 'p': togglePause(); break; - case 's': saveImage(); break; - case 'c': copyImage(); break; - case 'f': toggleFullscreen(); break; - case 'Escape': - if (controlsHidden) toggleControls(); - else stopScreensaver(); - break; - case 'h': toggleControls(); break; - case 'r': toggleAutoPrompt(); break; - } - }); - - window.showToast = function(message, duration = 3000) { - let toast = document.getElementById("toast-notification"); - if (!toast) { - toast = document.createElement("div"); + hideButton.addEventListener("click", (e) => { + e.stopPropagation(); + if (screensaverActive) toggleControls(); + else window.showToast("Start the screensaver first!"); + }); + + window.showToast = function(message, duration = 3000) { + let toast = document.getElementById("toast-notification"); + if (!toast) { + toast = document.createElement("div"); toast.id = "toast-notification"; toast.style.position = "fixed"; toast.style.top = "5%"; diff --git a/simple.js b/simple.js index 0ea998e..7b968fd 100644 --- a/simple.js +++ b/simple.js @@ -260,22 +260,15 @@ document.addEventListener("DOMContentLoaded", () => { appendSimpleMessage(msg.role, msg.content, index); }); - simpleInput.addEventListener("input", () => { - simpleSendBtn.disabled = simpleInput.value.trim() === ""; - simpleInput.style.height = "auto"; - simpleInput.style.height = simpleInput.scrollHeight + "px"; - }); - - simpleInput.addEventListener("keydown", (e) => { - if (e.key === "Enter" && !e.shiftKey) { - e.preventDefault(); - simpleSendBtn.click(); - } - }); - - simpleSendBtn.addEventListener("click", () => { - const message = simpleInput.value.trim(); - if (message === "") return; + simpleInput.addEventListener("input", () => { + simpleSendBtn.disabled = simpleInput.value.trim() === ""; + simpleInput.style.height = "auto"; + simpleInput.style.height = simpleInput.scrollHeight + "px"; + }); + + simpleSendBtn.addEventListener("click", () => { + const message = simpleInput.value.trim(); + if (message === "") return; const currentSession = Storage.getCurrentSession(); currentSession.messages.push({ role: "user", content: message }); Storage.updateSessionMessages(currentSession.id, currentSession.messages);