p3r1's avatar
p3r1
Occasional Reader
Sep 15, 2025
Status:
New

Feature Request: OfficeJS Enhancing Shortcuts and Conflict Resolution for Add-ins

We’ve encountered a few challenges while working with shortcuts in our add-in, particularly when it comes to detecting and handling conflicts. Here's a breakdown of the issues and some suggestions for improvement:

1.) Detecting Shortcut Conflicts:

Currently, we can use the areShortcutsInUse method to check if a shortcut is already in use when users attempt to set a new shortcut. However, we’ve realized that this function doesn't provide enough context. Specifically, it doesn’t inform us where the conflict is coming from.

Suggestion:
It would be incredibly helpful for our users if we could provide more detailed information about the conflict. For example:

Action ID: Identify which action (or command) the conflicting shortcut is associated with.
Add-in Name: Identify which add-in (including third-party add-ins) is causing the conflict.

This added clarity will not only improve the user experience by providing actionable information but will also help us troubleshoot issues more efficiently.

2.) Checking for Conflicts with Default Shortcuts:

We’ve encountered an issue when attempting to check for conflicts with default shortcuts listed in a JSON file. Since the areShortcutsInUse method reports that all shortcuts are technically “in use” (even if they are only being set by our add-in), it doesn’t allow us to accurately detect conflicts between user-defined shortcuts and the defaults.

Suggestion:
We would like the ability to distinguish between default shortcuts defined in the manifest and those set by the user or other add-ins. This will allow us to check for true conflicts (i.e., when a user-defined shortcut is in conflict with another user-defined shortcut or an active add-in).


3.) Unassigning Shortcuts:

Currently, there is no way to unassign a shortcut from an action; we cannot pass a null value to clear a shortcut. Passing an empty string results in the default shortcut being used, as defined in the JSON manifest. This limitation makes it difficult to fully customize shortcut management for users who wish to clear or reset shortcuts.

Suggestion:
It would be valuable to provide a method that allows us to unassign or reset a shortcut, either by passing a null value or a dedicated "clear" option. This flexibility will enable users to fully customize their shortcuts without being forced to keep default bindings when they don’t want them.

No CommentsBe the first to comment