Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/6942c9db-f3dc-8013-b29c-ff520370a65f
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== gpt-5-2-thinking == === User: how can I override keybinds with tampermonkey? === how can I override keybinds with tampermonkey? I have already deleted two great chats on accident (including a nice cooking recipe) by typing fast and hitting Shift+Ctrl+Backspace and then Enter since the "Confirm" button is automatically highlighted. I think it happened when I'm trying to add a newline without sending the message with Shift+Enter. It feels so stupid how easily and fast it happens, I don't know if it happens easier if the chat is laggy or if my fingers are just clumsy. Has anyone else had this happen to them? There doesn't seem to be a way to change keybinds. They seriously should change this or at least have the dialog auto-focus on the "Cancel" button when you invoke it. I want to null out shift ctrl backspace === Assistant: Yep — you can “null out” a key combo with Tampermonkey by catching the keyboard event early capture phase and calling: === Yep — you can “null out” a key combo with Tampermonkey by catching the keyboard event early (capture phase) and calling: * event.preventDefault() (stops browser/default behavior) * event.stopImmediatePropagation() (stops the site’s handlers) Here’s a Tampermonkey userscript that blocks Ctrl+Shift+Backspace (and optionally Ctrl+Shift+Delete too), on ChatGPT: <syntaxhighlight lang="js">// ==UserScript== // @name Block Ctrl+Shift+Backspace (ChatGPT) // @namespace local // @version 1.0 // @description Prevent accidental destructive hotkey // @match https://chatgpt.com/* // @match https://chat.openai.com/* // @run-at document-start // ==/UserScript== (function () { "use strict"; function isBlockedCombo(e) { // Normalize key detection across browsers: // Backspace = "Backspace", Delete = "Delete" const key = e.key; const ctrl = e.ctrlKey || e.metaKey; // include Cmd on macOS if you want const shift = e.shiftKey; // Primary: Ctrl+Shift+Backspace if (ctrl && shift && key === "Backspace") return true; // Optional: also block Ctrl+Shift+Delete (uncomment if desired) // if (ctrl && shift && key === "Delete") return true; return false; } function handler(e) { if (!isBlockedCombo(e)) return; // Stop everything e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); // Optional: tiny debug log // console.debug("Blocked hotkey:", e.key, { ctrl: e.ctrlKey, shift: e.shiftKey, meta: e.metaKey }); } // Capture phase so we run before the page’s listeners. window.addEventListener("keydown", handler, { capture: true }); })(); </syntaxhighlight> ===== How to use it ===== # Tampermonkey → Create a new script # Paste the code above # Save # Refresh ChatGPT ===== Notes / tweaks ===== * If you don’t want to treat Cmd as Ctrl on macOS, change: ``<code>js const ctrl = e.ctrlKey || e.metaKey; </code>`<code> to: </code>`<code>js const ctrl = e.ctrlKey; <syntaxhighlight>- If the site still catches it (rare), add a second listener on document too: </syntaxhighlight>js document.addEventListener("keydown", handler, { capture: true }); </code>`` If you tell me your OS/browser (Windows/Mac/Linux + Chrome/Firefox), I can tailor the exact key detection (some keyboards/layouts report slightly differently).
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)