Keyboard and mouse shortcuts are defined within InputConfig section of the Menuset in XXX_TABITEMS.XML files, where XXX can be Fred4, Ted4, Shell4, Edadmin4 or Admin4.
As keyboard and mouse shortcuts are attached to scripts, that can be captured in the Script Editor, it's reasonably simple to locate them.
See also Quick reference of keyboard and mouse shortcuts for the exhaustive list of all places where the shortcuts are defined.
This assumes that you've started a GN4 application, and that you are able to execute the shortcut you want to locate in configuration files. Note: some shortcuts can be executed only in specific context, e.g. if an article or a page are open. 1.In Ted4 or Fred4, display Script Editor (Window > Palettes > Script Editor). 2.Click the Capture button. 3.Press keys that belong to the shortcut you want to locate in the configuration. 4.Make a note of the string that appears in the Script Editor window. If a command has no parameters Search, as explained in Locate configuration items through Visual Studio Express search. If a command has parameters In case that a string, captured in the Script Editor appears to have parameters, such as ObjMove("R,C"), you need to perform a special search, using wildcards. 1.Launch Visual Studio Express add-ins solution, or just Visual Studio Express and then close the start page (if any). 2.Press SHIFT+CTRL+F to display Find in files dialog box, and then, in Find what, enter the following: Keybinding*ObjMove*R,C 3.In Look in, enter the path of the root of your configuration files folders. 4.Select Include sub-folders. 5.Under Find options, clear all options, and then select Use, and choose Wildcards. 6.In Look at these file types, enter *.XML 7.Click Find all to display results. The Find Results pane will show all occurrences of found string, with the full path of the file where it was found. Results include all configuration files. A result may look like (split in more lines for easier reading - in Visual Studio Express every path appears in one line only): Find all "Keybinding*ObjMove*R,C", Wildcards, Subfolders, Find Results 1, "C:\tera\GN4\main\config", "*.xml" C:\tera\GN4\main\config\global\GN4\fred4_TabItems.xml(2280): <KeyBinding CommandType="ParametersScript" CommandParameter="ObjMove" Param="R,C" Key="Right" /> C:\tera\GN4\main\config\global\GN4\fred4_TabItems.xml(2281): <KeyBinding CommandType="ParametersScript" CommandParameter="ObjMove" Param="R,c" Modifiers="CTRL" Key="Right" /> Matching lines: 2 Matching files: 1 Total files searched: 384 Double-click the line you want to display the related file and to locate the related line in the file. What if there are more lines with <KeyBinding...> found? In some situations, the same shortcut with the same script may be defined in more places in one file. This may happen in linked menusets. In order to locate the right definition, take into account the context in which you've run the shortcut, and identify the right menuset first. |
This assumes that you've started a GN4 application, and that on your screen you are looking at the menu you want to locate in configuration files. 1.In Ted4, or Fred4, on the Help menu, click Configuration details. 2.Look under MENUSET section: the name of the current menuset is displayed there. 3.Make a note of the name. 4.Perform the search with that name (with double quotes or without them), as explained in Locate configuration items through Visual Studio Express search. 5.Double-click the found line to display the related file and to put the cursor in the related line in the file. 6.Collapse all outlining by selecting twice Edit > Outlining > Toggle All Outlining. 7.Double-click the found line to put the cursor in the related line in the file (with all code collapsed - and more readable). How to recognize the right entry in results? Menuset definition start appears in line that contain <Menuset Name="whatever">. In the below example, we were looking for the Fred4Main. The appropriate line in results may look like: C:\tera\GN4\main\config\global\GN4\fred4_TabItems.xml(774): <Menuset Name="Fred4Main"> What if there are more lines found? The same name may be found in other lines such as the one below. If the name is not preceded by <Menuset Name=", then it's not the right line: C:\tera\GN4\main\config\global\GN4\fred4_TabItems.xml(93): <l:ShellTabItem x:Name="Fred4Pages" Header="Pages" MenuConfigName="Fred4Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:converters="clr-namespace:TeraDP.GN4.Common.Converters;assembly=Common" l:ShellUI.ZoneName="Main" ObjectTypeNames="page" Grid.IsSharedSizeScope="True"> In the above example, the line refers to the tabitem entry and not to the menuset definition. What if there are more lines with <MenuSet Name="..."> found? In some situations, a menuset may be defined in one file and re-defined in other file(s). In order to locate the right definition, remember the loading order for GN4 applications (the last loaded file has the priority) Ted4: loads first the SHELL4_TABITEMS.XML and then TED4_TABITEMS.XML. If the menu is defined in both files, TED4_TABITEMS.XML definition wins. Fred4: loads first SHELL4_TABITEMS.XML, then TED4_TABITEMS.XML, and then FRED4_TABITEMS.XML. If the menu is defined in all files, FRED4_TABITEMS.XML definition wins. |
After you located the menuset, as explained above, do following: 1.Expand <Menuset and locate the <InputConfig> line. 2.Expand the <InputConfig> line. <KeyBinding CommandType="Script" CommandParameter="GlobalCommand" Modifiers="CTRL" Key="G"/> <KeyBinding CommandType="Script" CommandParameter="ArticleNewDlg" Modifiers="CTRL" Key="N"/> <KeyBinding CommandType="Script" CommandParameter="MergeToNewArticle" Modifiers="ALT,SHIFT" Key="N"/> <KeyBinding CommandType="Script" CommandParameter="ToggleNavigator" Modifiers="ALT" Key="N"/> Note: in the linked menusets (see Menusets reference), there might be more <InputConfig> sections, each one activated in the related context (when no document is loaded, when a document is loaded, when editing text in a document etc). Important If you add a printable letter key as a shortcut in the <InputConfig> of the Main section, this will prevent you to use that letter when typing text. Add CTRL or ALT modifier to it to avoid problems. |