Quark XML Author 2015 October 2018 Update for Microsoft Word — System Admin Guide

Configuration: ShortcutKeys

Shortcut keys let you define keyboard combinations to common Quark XML Author commands. These commands are launched by pressing a single keystroke (for example, F12) or by pressing a combination of a keystroke and the Shift or Ctrl or Alt key. The ShortcutKeys section of the configuration files defines these shortcuts and the commands they launch.

The shortcut keys that should always be blocked are specified in the global XAShortcutKeysConfig.xml file. This file is deployed with every installation.

Shortcut keys can be defined and modified both the AppConfig and DocConfig files, and the procedures are the same in both files.

The order of precedence for key configurations is that the DocConfig overrides the AppConfig which overrides the global XAShortcutKeysConfig.xml file.

ShortcutKeys Configuration in the AppConfig File

ShortcutKeys can be configured in both the AppConfig and DocConfig files. Configuration in the AppConfig file will be reflected in the Word environment regardless of the active document class. Quark recommends that you do not modify XAShortcutKeysConfig.xml, but use the AppConfig file to configure shortcuts that you want users to be able to use even if they have a standard Word document open.

ShortcutKeys Configuration in the DocConfig File

Use the DocConfig file to configure shortcuts that should only be available for a specific document class. You may also need to block standard Word shortcuts in the DocConfig file; how to block shortcuts is covered in section 8.9.

Associating Shortcut Keys with Menu Items and CommandBarButtons

Menu Items and CommandBar Buttons can both have shortcut keys associated with them through the use of the ShortcutKey child element. To assign a shortcut to a Menu Item or CommandBar Button, include an empty ShortcutKey element in the MenuItem or CommandBarButton element.

ShortcutKey

The ShortcutKey element’s attributes specify the character to use, and whether the Shift, Ctrl, Alt, or some combination of the three are part of the shortcut key combination. In the example below, the combination Ctrl + O launches the command:

<ShortcutKey key="o" shift="false" ctrl="true"/>

The Key attribute value is the character to use. The values of shift and ctrl are set to false if they are not used in the shortcut key, or true if they are. In the example below, the combination Ctrl + Shift + x launches the menu item:

<ShortcutKey key="x" shift="true" ctrl="true"/>

Note that the values are case-sensitive.

Table 3‑1: ShortcutKey Attributes

Attribute

Type

Required

Definition

alt

boolean

no

If set to true, the Alt key is part of the shortcut key combination. Set to false if the Alt key is not used.

ctrl

boolean

yes

If set to true, the Ctrl key is part of the shortcut key combination. Set to false if the Ctrl key is not used.

key

string

yes

The keyboard key that is used in the shortcut key combination. All keys on the keyboard can be configured except for Backspace and Tab. Numeric keypad keys can be configured using the values shown in Table 3‑2. The enter key may be represented by either Return or Enter.

shift

boolean

yes

If set to true, the Shift key is part of the shortcut key combination. Set to false if the Shift key is not used.

 

Table 3‑2: Numeric KeyPad Key Values

Keypad Key

Key Attribute Value

1

NumPad1

2

NumPad2

3

NumPad3

4

NumPad4

5

NumPad5

6

NumPad6

7

NumPad7

8

NumPad8

9

NumPad9

0

NumPad0

/

Divide

*

Multiply

-

Subtract

+

Add

.

Decimal

Table 3‑2: Numeric KeyPad Key Values

Supported Keys

Supported keys can be used in any combination with Shift, Ctrl, and Alt keys.

The list of supported keys includes:

+,=,_,-,|,\,{,},[,],~,`,?,/,>,.,<,,(comma),\,’,; , Return, Enter

The list of supported virtual keys includes:

            13, 186 – 192, 219 - 222

Unsupported Keys

The list of supported keys includes:

Home, End, Page Up, Page Down, Arrow keys, Tab, Enter

InternalClass

If the shortcut is for an internal command (one launched within Microsoft Word, such as Cut, Copy, or Paste), add an InternalClass child element to the ShortcutKey element.

The InternalClass element identifies the internal class value (for example, Cut) that will launch the command. Enter the internal class name as the value of the name attribute of the InternalClass element, as shown in the example below.

<InternalClass name="Cut"/>

In the example below, the shortcut key combination Shift + Del will cut the selection from the document and place it on the clipboard.

<ShortcutKey Key="DEL" Shift="true" Ctrl="false">
  <InternalClass name="Cut"/>
</ShortcutKey>

ExtensibilityInterface

If the shortcut is for an external command (one that launches an external process), add an ExtensibilityMethod child element to the ShortcutKey element.

The ExtensibilityMethod element identifies the ExtensibilityInterface method (such as Popup) that will launch the command. The ExtensibilityMethod element has one required attribute: id. The value of the id attribute is the name of the Extensibility Method specified in the EI node of the configuration file. An example is shown below.

<ExtensibilityMethod id="Popup"/>

In the following example, the shortcut key F12 launches the Popup ExtensibilityInterface Method.

<ShortcutKey Key="F12" Shift="false" Ctrl="false">
  <ExtensibilityMethod id="Popup"/>
</ShortcutKey>

ExtensibilityInterface methods are defined in the Extensibility Interface, which is covered in Section 6.

Global Shortcut Key File: Disabling Shortcut Keys

The Global Shortcut Key file contains the list of shortcut keys that are disabled by Quark XML Author in all configurations.

The following is a fragment of the XAShortcutKeysConfig .xml file:

<?xml version="1.0" encoding="utf-8"?>
<!-- This is a list of universal shortcuts to disable on all configurations.  Keys can be repurposed in DocConfig ShortcutKeys node. -->
<ShortcutKeys>
  <ShortcutKey key="B" shift="true" ctrl="true" />
  <!-- remove bold -->
  <ShortcutKey key="C" shift="true" ctrl="true" />
  <!-- copy formatting -->
  <ShortcutKey key="D" ctrl="true" />
  <!-- font dialog -->
</ShortcutKeys>