Skip to content

Commit

Permalink
[Word] (keyboard shortcuts) Fix shortcuts and add note about support …
Browse files Browse the repository at this point in the history
…in Word on the web (#897)

* Update shortcuts and test manifest

* Clarify support in Word on the web and revert manifest changes
  • Loading branch information
samantharamon authored Dec 5, 2024
1 parent 1cf5e2e commit bcc4138
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
12 changes: 8 additions & 4 deletions Samples/office-keyboard-shortcuts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ description: "This sample shows how to add keyboard shortcuts to your Office Add

This sample shows how to create custom keyboard shortcuts for an Office Add-in. Keyboard shortcuts let power users quickly use your add-in's features and give accessibility options to avoid using a mouse. In this sample, the following shortcuts are configured.

- **Ctrl+Alt+1**: Opens the add-in's task pane.
- **Ctrl+Alt+2**: Hides the add-in's task pane.
- **Ctrl+Alt+3**: Performs an action that's specific to the current Office host.
- **Ctrl+Alt+Up arrow key**: Opens the add-in's task pane.
- **Ctrl+Alt+Down arrow key**: Hides the add-in's task pane.
- **Ctrl+Alt+Q**: Performs an action that's specific to the current Office host.
- **Excel**: Cycles through colors in the currently selected cell.
- **Word**: Adds text to the document.

Expand All @@ -41,6 +41,9 @@ Keyboard shortcuts can be used to achieve any action within the add-in runtime.
- Office on the web
- Excel
- Word

> **Note**: The keyboard shortcut feature is currently being rolled out to Word on the web. If you test the feature in Word on the web at this time, the shortcuts may not work if they're activated from within the add-in's task pane. We recommend to periodically check [Keyboard Shortcuts requirement sets](https://learn.microsoft.com/javascript/api/requirement-sets/common/keyboard-shortcuts-requirement-sets) to find out when the feature is fully supported.
- Office on Windows
- Excel: Version 2111 (Build 14701.10000)
- Word: Version 2408 (Build 17928.20114)
Expand All @@ -65,6 +68,7 @@ Keyboard shortcuts can be used to achieve any action within the add-in runtime.
| 1.0 | 11-5-2020 | Initial release |
| 1.1 | May 11, 2021 | Removed yo office and modified to be GitHub hosted |
| 2.0 | September 27, 2024 | Added support for Word |
| 2.1 | December 5, 2024 | Updated keyboard shortcuts |

## Disclaimer

Expand Down Expand Up @@ -132,7 +136,7 @@ If you prefer to host the web server for the sample on your computer, follow the

Once the add-in is loaded, try out its functionality.

1. Press **Ctrl+Alt+1** on your keyboard to open the add-in's task pane.
1. Press **Ctrl+Alt+Up arrow key** on your keyboard to open the add-in's task pane.

> [!NOTE]
> If the keyboard shortcut is already in use in Excel or Word, a dialog will be shown so that you can select which action you'd like to map to the shortcut. Once you select an action, you can change your preference by invoking the **Reset Office Add-in Shortcut Preferences** command from the search field.
Expand Down
6 changes: 3 additions & 3 deletions Samples/office-keyboard-shortcuts/src/shortcuts.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
{
"action": "ShowTaskpane",
"key": {
"default": "Ctrl+Alt+1"
"default": "Ctrl+Alt+Up"
}
},
{
"action": "HideTaskpane",
"key": {
"default": "Ctrl+Alt+2"
"default": "Ctrl+Alt+Down"
}
},
{
"action": "RunAction",
"key": {
"default": "Ctrl+Alt+3"
"default": "Ctrl+Alt+Q"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions Samples/office-keyboard-shortcuts/src/taskpane.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ <h2 class="ms-font-xl">Please sideload your add-in to see app body.</h2>
<p class="ms-font-m"> Try the following keyboard shortcuts.</p>
<ul class="ms-List ms-welcome__features">
<li class="ms-ListItem">
<span class="ms-font-m"><b>Ctrl+Alt+1</b>: Open the add-in's task pane.</span>
<span class="ms-font-m"><b>Ctrl+Alt+Up arrow key</b>: Open the add-in's task pane.</span>
</li>
<li class="ms-ListItem">
<span class="ms-font-m"><b>Ctrl+Alt+2</b>: Hide the add-in's task pane.</span>
<span class="ms-font-m"><b>Ctrl+Alt+Down arrow key</b>: Hide the add-in's task pane.</span>
</li>
<li class="ms-ListItem">
<span class="ms-font-m">
<b>Ctrl+Alt+3</b>: Run an action that's specific to the current Office host.
<b>Ctrl+Alt+Q</b>: Run an action that's specific to the current Office host.
In Excel, this shortcut cycles through colors in the currently selected cell.
In Word, this shortcut adds text to the document.
</span>
Expand Down

0 comments on commit bcc4138

Please sign in to comment.