Skip to content

Commit bec1480

Browse files
authored
Merge pull request MicrosoftDocs#1763 from MicrosoftDocs/master
2/13/2019 AM Publish
2 parents f4be868 + d1f56b1 commit bec1480

13 files changed

Lines changed: 446 additions & 565 deletions

.openpublishing.redirection.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7980,6 +7980,41 @@
79807980
"redirect_url": "/cpp/windows/resource-files-visual-studio",
79817981
"redirect_document_id": false
79827982
},
7983+
{
7984+
"source_path": "docs/windows/viewing-resource-symbols.md",
7985+
"redirect_url": "/cpp/windows/creating-new-symbols",
7986+
"redirect_document_id": false
7987+
},
7988+
{
7989+
"source_path": "docs/windows/opening-the-resource-editor-for-a-given-symbol.md",
7990+
"redirect_url": "/cpp/windows/creating-new-symbols",
7991+
"redirect_document_id": false
7992+
},
7993+
{
7994+
"source_path": "docs/windows/changing-unassigned-symbols.md",
7995+
"redirect_url": "/cpp/windows/changing-a-symbol-or-symbol-name-id",
7996+
"redirect_document_id": false
7997+
},
7998+
{
7999+
"source_path": "docs/windows/including-shared-read-only-or-calculated-symbols.md",
8000+
"redirect_url": "/cpp/windows/changing-a-symbol-or-symbol-name-id",
8001+
"redirect_document_id": false
8002+
},
8003+
{
8004+
"source_path": "docs/windows/viewing-and-editing-resources-in-a-resource-editor.md",
8005+
"redirect_url": "/cpp/windows/resource-editors",
8006+
"redirect_document_id": false
8007+
},
8008+
{
8009+
"source_path": "docs/windows/setting-accelerator-properties.md",
8010+
"redirect_url": "/cpp/windows/accelerator-editor",
8011+
"redirect_document_id": false
8012+
},
8013+
{
8014+
"source_path": "docs/windows/editing-accelerator-tables.md",
8015+
"redirect_url": "/cpp/windows/accelerator-editor",
8016+
"redirect_document_id": false
8017+
},
79838018
{
79848019
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
79858020
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

docs/windows/TOC.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,14 @@
1414
#### [How to: Manage Resources](how-to-copy-resources.md)
1515
#### [How to: Include Resources at Compile Time](how-to-include-resources-at-compile-time.md)
1616
### [Symbols: Resource Identifiers](symbols-resource-identifiers.md)
17-
#### [Viewing Resource Symbols](viewing-resource-symbols.md)
18-
#### [Creating New Symbols](creating-new-symbols.md)
19-
#### [Changing or Deleting Unassigned Symbols](changing-unassigned-symbols.md)
20-
#### [Opening the Resource Editor for a Given Symbol](opening-the-resource-editor-for-a-given-symbol.md)
21-
#### [Changing a Symbol](changing-a-symbol-or-symbol-name-id.md)
22-
#### [Including Shared (Read-Only) or Calculated Symbols](including-shared-read-only-or-calculated-symbols.md)
17+
#### [How to: Create Symbols](creating-new-symbols.md)
18+
#### [How to: Manage Symbols](changing-a-symbol-or-symbol-name-id.md)
2319
#### [Predefined Symbol IDs](predefined-symbol-ids.md)
2420
##### [ATL Predefined Symbols](atl-predefined-symbols.md)
2521
##### [MFC Predefined Symbols](mfc-predefined-symbols.md)
2622
##### [Win32 Predefined Symbols](win32-predefined-symbols.md)
2723
### [Resource Editors](resource-editors.md)
28-
#### [Viewing and Editing Resources in a Resource Editor](viewing-and-editing-resources-in-a-resource-editor.md)
2924
#### [Accelerator Editor](accelerator-editor.md)
30-
##### [Setting Accelerator Properties](setting-accelerator-properties.md)
31-
##### [Editing Accelerator Tables](editing-accelerator-tables.md)
3225
##### [Accelerator Keys](predefined-accelerator-keys.md)
3326
#### [Binary Editor](binary-editor.md)
3427
#### [Dialog Editor](dialog-editor.md)

docs/windows/accelerator-editor.md

Lines changed: 155 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "Accelerator Editor (C++)"
33
ms.date: "11/04/2016"
4-
f1_keywords: ["vc.editors.accelerator.F1"]
5-
helpviewer_keywords: ["accelerator tables [C++], editing", "tables [C++], accelerator key", "accelerator keys [C++]", "resource editors [C++], Accelerator editor", "keyboard shortcuts [C++], Accelerator editor"]
4+
f1_keywords: ["vc.editors.accelerator.F1", "vc.editors.accelerator"]
5+
helpviewer_keywords: ["accelerator tables [C++], editing", "tables [C++], accelerator key", "accelerator keys [C++]", "resource editors [C++], Accelerator editor", "keyboard shortcuts [C++], Accelerator editor", "accelerator properties", "properties [C++], accelerator properties", "Type property", "Key property", "Modifier property", "VIRTKEY", "Key property", "ID property", "accelerator tables [C++], editing", "keyboard shortcuts [C++], editing in an accelerator table", "searching, in accelarator tables", "accelerator tables [C++], finding entries", "accelerator tables [C++], adding entries", "New Accelerator command", "accelerator tables [C++], deleting entries", "keyboard shortcuts [C++], deleting entry from accelerator table", "accelerator tables [C++], copying entries", "rc files [C++], moving an accelerator table entry", ".rc files [C++], moving accelerator table entries", "accelerator tables [C++], moving entries", "keyboard shortcuts [C++], property changing", "accelerator tables [C++], changing properties"]
66
ms.assetid: 013c30b6-5d61-4f1c-acef-8bd15bed7060
77
---
88
# Accelerator Editor (C++)
@@ -13,28 +13,170 @@ Normally, accelerators are used as keyboard shortcuts for program commands that
1313

1414
You can use [Class View](/visualstudio/ide/viewing-the-structure-of-code) to hook accelerator key commands to code.
1515

16-
With the **Accelerator** editor, you can:
16+
For a list of pre-defined accelerator keys, see [Predefined Accelerator Keys](../windows/predefined-accelerator-keys.md).
1717

18-
- [Set Accelerator Properties](../windows/setting-accelerator-properties.md)
18+
> [!TIP]
19+
> While using the **Accelerator** editor, you can right-click to display a shortcut menu of frequently used commands. The commands available depend on what the pointer is pointing to.
1920
20-
- [Associate an Accelerator Key with a Menu Item](../windows/associating-an-accelerator-key-with-a-menu-item.md)
21+
> [!NOTE]
22+
> Windows does not allow you to create empty accelerator tables. If you create an accelerator table with no entries, it is deleted automatically when you save the table.
2123
22-
- [Edit Accelerator Tables](../windows/editing-accelerator-tables.md)
24+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
2325

24-
- [Use Predefined Accelerator Keys](../windows/predefined-accelerator-keys.md)
26+
## Accelerator properties
2527

26-
> [!TIP]
27-
> While using the **Accelerator** editor, you can right-click to display a shortcut menu of frequently used commands. The commands available depend on what the pointer is pointing to.
28+
You can set accelerator properties in the [Properties window](/visualstudio/ide/reference/properties-window) at any time. You can also use the **Accelerator** editor to modify the accelerator properties in the accelerator table. Changes made using the **Properties** window or the **Accelerator** editor have the same result: edits are immediately reflected in the accelerator table.
29+
30+
### ID property
31+
32+
The **ID** property references each accelerator table entry in program code. This entry is the command value that the program will receive when a user presses the accelerator key or a key combination. To make an accelerator the same as a menu item, make their IDs the same (so long as the ID of the accelerator table is the same as the ID for the menu resource).
33+
34+
There are three properties for each accelerator ID: the **Modifier** property, the **Key** property, and the **Type** property.
35+
36+
#### Modifier property
37+
38+
The **Modifier** property sets control key combinations for the accelerator.
39+
40+
> [!NOTE]
41+
> In the **Properties** window, this property appears as three separate **Boolean** properties, all of which can be controlled independently: **Alt**, **Ctrl**, and **Shift**.
42+
43+
The following are legal entries for the **Modifier** property in the accelerator table:
44+
45+
|Value|Description|
46+
|-----------|-----------------|
47+
|**None**|User presses only the **Key** value. This value is most effectively used with the ASCII/ANSI values 001 through 026, which is interpreted as ^A through ^Z (**Ctrl+A** through **Ctrl+Z**).|
48+
|**Alt**|User must press the **Alt** key before the **Key** value.|
49+
|**Ctrl**|User must press the **Ctrl** key before the **Key** value. Not valid with ASCII Type.|
50+
|**Shift**|User must press the **Shift** key before the **Key** value.|
51+
|**Ctrl+Alt**|User must press the **Ctrl** key and the **Alt** key before the **Key** value. Not valid with ASCII Type.|
52+
|**Ctrl+Shift**|User must press the **Ctrl** key and the **Shift** key before the **Key** value. Not valid with ASCII Type.|
53+
|**Alt+Shift**|User must press the **Alt** key and the **Shift** key before the **Key** value. Not valid with ASCII Type.|
54+
|**Ctrl+Alt+Shift**|User must press **Ctrl**, **Alt**, and **Shift** before the **Key** value. Not valid with ASCII Type.|
55+
56+
#### Key property
57+
58+
The **Key** property sets the actual key to use as the accelerator.
59+
60+
The following are legal entries for the **Key** property in the accelerator table:
61+
62+
|Value|Description|
63+
|-----------|-----------------|
64+
|An integer between 0 and 255 in decimal format.|The value determines whether the value is treated as ASCII or ANSI as follows:<br/><br/>- Single-digit numbers are always interpreted as the corresponding key, rather than as ASCII or ANSI values.<br/>- Values from 1 through 26, when preceded with zeros, are interpreted as ^A through ^Z, which represents the ASCII value of the letters of the alphabet when pressed with the **Ctrl** key held down.<br/>- Values from 27-32 are always interpreted as three-digit decimal values 027 through 032.<br/>- Values from 033 through 255, whether preceded by 0's or not are interpreted as ANSI values.|
65+
|A single keyboard character.|Uppercase A - Z or the numbers 0 - 9 can be either ASCII or virtual key values; any other character is ASCII only.|
66+
|A single keyboard character in the range A - Z (uppercase only), preceded by a caret (^) (for example, ^C).|This option enters the ASCII value of the key when it's pressed with the **Ctrl** key held down.|
67+
|Any valid virtual key identifier.|The drop-down Key box in the Accelerator table contains a list of standard virtual key identifiers.|
68+
69+
> [!NOTE]
70+
> When entering an ASCII value, the modifier property options are limited. The only control key available for use is the **Alt** key.
71+
72+
> [!TIP]
73+
> Another way to define an accelerator key is to right-click an entry or multiple entries in the Accelerator table, choose **Next Key Typed** from the shortcut menu, and then press any of the keys or key combinations on the keyboard. The **Next Key Typed** command is also available from the **Edit** menu.
74+
75+
#### Type property
76+
77+
The **Type** property determines whether the shortcut key combination associated with the accelerator ID is interpreted as an ASCII/ANSI key value or a virtual key (VIRTKEY) combination.
78+
79+
- If the **Type** property is ASCII, the **Modifier** property may only be `None` or `Alt`, or it can have an accelerator that uses the **Ctrl** key (specified by preceding the key with a `^`).
80+
81+
- If the **Type** property is VIRTKEY, any combination of `Modifier` and `Key` values is valid.
82+
83+
> [!NOTE]
84+
> If you want to enter a value into the accelerator table and have the value be treated as ASCII/ANSI, simply click the **Type** for the entry in the table and select ASCII from the drop down list. However, if you use the **Next Key Typed** command (**Edit** menu) to specify the `Key`, you must change the **Type** property from VIRTKEY to ASCII *before* entering the `Key` code.
85+
86+
## Accelerator tables
87+
88+
In a C++ project, you can edit an accelerator table directly with in-place editing in the **Accelerator** editor.
89+
90+
The procedures below refer to the use of standard property pages, however, both in-place editing and the property page method have the same result. Changes made using property pages or using in-place editing are immediately reflected in the accelerator table.
91+
92+
> [!NOTE]
93+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
94+
95+
### To edit in an accelerator table
96+
97+
1. Open the accelerator table by double-clicking its icon in [Resource View](../windows/resource-view-window.md).
98+
99+
1. Select an entry in the table and select to activate in-place editing.
100+
101+
1. Select from the drop-down combo box or type in place to make changes.
102+
103+
- For **ID**, select from the list or type to edit.
104+
105+
- For **Modifier**, select from the list.
106+
107+
- For **Key**, select from the list or type to edit.
108+
109+
- For **Type**, select **ASCII** or **VIRTKEY** from the list.
110+
111+
### To find an entry in an open accelerator table
112+
113+
1. Open the accelerator table by double-clicking its icon in [Resource View](../windows/resource-view-window.md).
114+
115+
1. Select a column head to sort the contents of the column alphabetically. For example, select **ID** to display all the IDs in your accelerator table alphabetically.
116+
117+
You can then scan the list and find the entry.
118+
119+
### To add an entry to an accelerator table
120+
121+
1. Open the accelerator table by double-clicking its icon in [Resource View](../windows/resource-view-window.md).
122+
123+
1. Right-click within the accelerator table and choose **New Accelerator** from the shortcut menu, or select the empty row entry at the bottom of the table.
124+
125+
1. Select an **ID** from the drop-down list in the ID box or type a new ID in the **ID** box.
126+
127+
1. Type the **Key** you want to use as an accelerator or right-click and choose **Next Key Typed** from the shortcut menu to set a key combination (the **Next Key Typed** command is also available from the **Edit** menu).
128+
129+
1. Change the **Modifier** and **Type**, if necessary.
130+
131+
1. Press **Enter**.
28132

29133
> [!NOTE]
30-
> Windows does not allow you to create empty accelerator tables. If you create an accelerator table with no entries, it is deleted automatically when you save the table.
134+
> Make sure all accelerators you define are unique. You can have several key combinations assigned to the same ID with no ill effect, for example, **Ctrl** + **P** and **F8** can both be assigned to ID_PRINT. However, having a key combination assigned to more than one ID will not work well, for example, **Ctrl** + **Z** assigned to both ID_SPELL_CHECK and ID_THESAURUS.
135+
136+
### To delete an entry from an accelerator table
137+
138+
1. Open the accelerator table by double-clicking its icon in [Resource View](../windows/resource-view-window.md).
31139

32-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
140+
1. Select the entry you want to delete. (Hold down the **Ctrl** or **Shift** key while selecting to choose multiple entries.)
141+
142+
1. Right-click and choose **Delete** from the shortcut menu (or select **Delete** from the **Edit** menu).
143+
144+
> [!TIP]
145+
> A shortcut for delete is to press the **Delete** key.
146+
147+
### To move or copy an accelerator table entry to another resource script file
148+
149+
1. Open the accelerator tables in both resource script files.
150+
151+
1. Select the entry you want to move.
152+
153+
1. From the **Edit** menu, choose **Copy** or **Cut**.
154+
155+
1. Select an entry in the target resource script file.
156+
157+
1. From the **Edit** menu, choose **Paste**.
158+
159+
> [!NOTE]
160+
> You can also use the shortcut keys for copying and pasting.
161+
162+
### To change the properties of multiple accelerator keys
163+
164+
1. Open the accelerator table by double-clicking its icon in [Resource View](../windows/resource-view-window.md).
165+
166+
1. Select the accelerator keys you want to change by holding down the **Ctrl** key as you select each one.
167+
168+
1. Go to the [Properties window](/visualstudio/ide/reference/properties-window) and type in the values you want all of the selected accelerators to share.
169+
170+
> [!NOTE]
171+
> Each modifier value appears as a Boolean property in the **Properties** window. If you change a [Modifier](../windows/accelerator-modifier-property.md) value in the **Properties** window, the accelerator table treats the new modifier as an addition to any modifiers that were previously there. Because of this, if you set any modifier values, you will need to set all of them to ensure that every accelerator shares the same **Modifier** settings.
33172
34173
## Requirements
35174

36175
Win32
37176

38-
## See Also
177+
## See also
178+
179+
[Resource Editors](../windows/resource-editors.md)
39180

40-
[Resource Editors](../windows/resource-editors.md)
181+
[Editing in an Accelerator Table](../windows/editing-in-an-accelerator-table.md)<br/>
182+
[Predefined Accelerator Keys](../windows/predefined-accelerator-keys.md)<br/>

0 commit comments

Comments
 (0)