Macro Menu (Right Shift + R Toggle)

UI-only macro menu with Right Shift and R toggle

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Macro Menu (Right Shift + R Toggle)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  UI-only macro menu with Right Shift and R toggle
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // -----------------------------
    // Create Menu
    // -----------------------------
    const menu = document.createElement("div");
    menu.id = "macroMenu";
    menu.innerHTML = `
        <h2>Macro Menu</h2>
        <p>Status: <span id="featureStatus" style="color:#ff4444;">OFF</span></p>
        <p>Press <b>R</b> to toggle feature</p>
    `;
    document.body.appendChild(menu);

    // -----------------------------
    // Style
    // -----------------------------
    const style = document.createElement("style");
    style.textContent = `
        #macroMenu {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.8);
            background: rgba(20, 20, 20, 0.92);
            padding: 20px;
            border-radius: 12px;
            color: white;
            font-family: Arial, sans-serif;
            z-index: 999999999;
            display: none;
            width: 260px;
            text-align: center;
            transition: 0.15s ease;
            border: 1px solid #444;
            box-shadow: 0 0 20px rgba(0,0,0,0.4);
        }

        #macroMenu.open {
            display: block;
            transform: translate(-50%, -50%) scale(1);
        }

        #macroMenu h2 {
            margin-top: 0;
            color: #7ab6ff;
        }
    `;
    document.head.appendChild(style);

    // -----------------------------
    // Logic
    // -----------------------------
    let menuOpen = false;
    let featureEnabled = false;

    // Toggle menu with Right Shift
    window.addEventListener("keydown", (e) => {
        if (e.code === "ShiftRight") {
            menuOpen = !menuOpen;
            menu.classList.toggle("open", menuOpen);
        }
    });

    // Toggle feature with R
    window.addEventListener("keydown", (e) => {
        if (e.code === "KeyR") {
            featureEnabled = !featureEnabled;
            document.getElementById("featureStatus").textContent = featureEnabled ? "ON" : "OFF";
            document.getElementById("featureStatus").style.color = featureEnabled ? "#44ff44" : "#ff4444";

            // 🔧 This is where YOU add whatever you want the toggle to do
            // Example: console.log("Feature is now", featureEnabled);
        }
    });

})();