LibreChat Shortcuts + Token Counter

Keyboard Shortcuts for LibreChat

< Feedback on LibreChat Shortcuts + Token Counter

Review: Good - script works

§
Posted: 2025-06-13

Thank you for the great script. It is super useful.
It would be nice to have a shortcut for turn on/off temporary chat.

Brian HurdAuthor
§
Posted: 2025-06-23

Sure. Just added it with alt+p for private chat. You can change the key by directly editing the script. Just search for alt+p section and change the p in this line:
if (!e.altKey || e.key.toLowerCase() !== 'p') return;

§
Posted: 2025-09-06

Thank you for the adjustment. I noticed one thing is missing: Ctrl + Backspace is not currently working. This shortcut is useful for deleting entire words at a time, and it would be great to have it back.

Brian HurdAuthor
§
Posted: 2025-09-22

Sure. I had it set to be a shortcut to stop generation. So, I just updated it so it can be used to still stop generation but not block the default behavior of deleting the last word. So, don't use it while librechat is actively generating. But, if you just want to get rid of it, just delete this block:

    document.addEventListener('keydown', function (e) {
        // Ctrl+Backspace - STOP (but don't block word-delete in editable fields)
        if (e.ctrlKey && (e.key === 'Backspace' || e.code === 'Backspace')) {
            const stop = () => {
                const stopBtn = document.querySelector('button[aria-label="Stop generating"]:not([disabled])');
                if (stopBtn) stopBtn.click();
            };

            if (isEditable(e.target)) {
                // Let the default deletion happen, then stop
                // Using a timeout ensures default action runs before we possibly change focus.
                setTimeout(stop, 0);
            } else {
                e.preventDefault();
                stop();
            }
            return;
        }

Post reply

Sign in to post a reply.