LibreChat Shortcuts + Token Counter

Keyboard Shortcuts for LibreChat

< Σχολιασμός για τον κώδικα LibreChat Shortcuts + Token Counter

Αναφορά: Καλός - ο κώδικας λειτουργεί

§
Δημοσιεύτηκε: 13/06/2025

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 HurdΔημιουργός
§
Δημοσιεύτηκε: 23/06/2025

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;

§
Δημοσιεύτηκε: 06/09/2025

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 HurdΔημιουργός
§
Δημοσιεύτηκε: 22/09/2025

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;
        }

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.