Share via

can we implement ctrl+shift+[ and ctrl+shift+{ as the shortcut keys for our custom addin functionality to be hit

priyanka anusuri 0 Reputation points
2026-06-18T14:32:34.4533333+00:00

we have an Office 365 excel Add-in in web browser and we want to trigger few functionalities when we hit these ctrl+shift+[ and ctrl+shift+{ .

is it possible to do if yes what are all the ways we have

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

2 answers

Sort by: Most helpful
  1. Jay Tr 12,960 Reputation points Microsoft External Staff Moderator
    2026-06-18T16:31:40.9633333+00:00

    Hi @priyanka anusuri

    Thank you for reaching out and for sharing your concern. 

    To trigger features when Ctrl+Shift+[ and Ctrl+Shift+{ are pressed, I would recommend using a JavaScript listener inside your add-in's task pane. An Office add-in is essentially a web page that Excel loads, and it does not include any keyboard shortcut by default, so this listener is what gives it the ability to respond to a key combination. The listener and the functions you want to run both live inside the same add-in page, so when the listener detects the keys it simply calls your function directly. 

    Here is a basic example you can use: 

    document.addEventListener("keydown", function (event) {
      // Ctrl + Shift + [ (the "{" character is produced by Shift + [)
      if (event.ctrlKey && event.shiftKey && event.key === "{") {
        event.preventDefault();
        runFeatureOne();
      }
    });
    function runFeatureOne() {
      // Your functionality goes here
      console.log("Feature triggered");
    }
    
    

    To quickly test this code in your browser console, please follow these steps: 

    1. Open your add-in in the browser so the task pane is visible. 
    2. Right click anywhere inside the task pane and select Inspect to open the browser developer tools. 
    3. In the developer tools window, select the Console tab. 
    4. Paste the code above into the console and press Enter to register the listener. 
    5. Click inside the task pane, then press Ctrl+Shift+[ to confirm the function runs. You should see the "Feature triggered" message appear in the console. 

    Please note that code entered directly in the console is temporary and only lasts for the current session. Once you have confirmed it works, you would move the same code into the JavaScript file loaded by your task pane so it runs automatically each time the add-in opens. 

    One point worth noting is that Ctrl+Shift+[ and Ctrl+Shift+{ are produced by the same physical key, since the { character is simply Shift plus the [ key. Because of this, the two cannot be reliably distinguished as separate shortcuts, so if you need two different features triggered, I would suggest using two distinct keys instead. 

    Another important limitation is focus. This listener only works while the user is clicked inside the task pane. As soon as focus moves to the spreadsheet cells, the page no longer receives the keystrokes, so the listener will not fire. 

    I hope this information is helpful. Please follow the steps above and let me know if it works for you. If not, we can continue working together to resolve the issue.  

    Thank you for your patience and understanding. If you have any questions or need additional assistance, please don’t hesitate to reach out so I can continue to support you. If you found the response useful, please consider marking it as accepted, as this may help other community members who are looking for similar guidance.  

    I look forward to continuing the conversation.  


    If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.     

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-06-18T14:33:00.35+00:00

    Yes, it is possible to define custom shortcuts for an Office Excel add-in, but there are important constraints and browser limitations to consider.

    1. Allowed key combinations for add-ins
      Custom shortcuts must follow the Office add-in rules:
      • Must include at least one modifier key (Alt/Option, Ctrl/Cmd, Shift) and only one other key, joined with + (for example, Ctrl+Shift+A).
      • Allowed non-modifier keys are A–Z, 0–9, and the punctuation marks -, _, and +.
      • When two characters share the same physical key, they are treated as synonyms (for example, Ctrl+- and Ctrl+_).
      Because { and [ are produced from the same physical key on many keyboard layouts (for example, [ vs { via Shift), Office treats shortcuts by physical key, not by the shifted character. So Ctrl+Shift+[ and Ctrl+Shift+{ would effectively be the same shortcut from the add-in’s perspective.
    2. Browser and web limitations
      For Office on the web:
      • Custom keyboard shortcuts only work when focus is on the document (worksheet), not when focus is in the task pane.
      • Some browser-reserved shortcuts cannot be overridden by add-ins (for example, Ctrl+X, Ctrl+C, Ctrl+V, etc.). The documented list does not include Ctrl+Shift+[ specifically, so it is not known from this context to be blocked by the browser.
    3. Defining the shortcuts in an Excel add-in
      To implement custom shortcuts such as Ctrl+Shift+[:
      • Configure the add-in to use a shared runtime.
      • Create a shortcuts JSON file and define actions and shortcuts:
        • Each action has an actions.id and actions.name.
        • Each shortcut maps a shortcuts.action to a shortcuts.key.default and optionally platform-specific keys (windows, mac, web).
      • Link the shortcuts JSON file in the add-in manifest using the ExtendedOverrides element.
      • Use Office.actions.associate in the shared runtime to map each action ID to the corresponding JavaScript function that implements the custom functionality.
    4. Conflict handling and best practices
      • Excel and other add-ins may already use certain shortcuts. When a conflict exists, the first time the user presses the shortcut, Office shows a dialog listing all registered actions and lets the user choose which one to use. The user’s choice is then saved as a preference.
      • To minimize conflicts, guidance recommends using patterns like Ctrl+Shift+Alt+X and avoiding established Excel shortcuts.
      • On the web, some shortcuts cannot be overridden at all due to browser reservations; if Ctrl+Shift+[ is one of those in practice, it will not be usable even if defined in the manifest.
    5. Checking availability and user customization
      • Use Office.actions.areShortcutsInUse to check whether a planned shortcut (for example, Ctrl+Shift+1) is already in use before assigning it.
      • Use Office.actions.getShortcuts() to inspect the shortcuts currently registered for the user.

    In summary, defining a shortcut like Ctrl+Shift+[ for an Excel web add-in is supported by the add-in keyboard shortcut framework if the browser does not reserve it, but { vs [ cannot be distinguished as separate shortcuts because they share the same physical key. Implementation is done via the shortcuts JSON file, shared runtime, and Office.actions.associate.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.