Customizing your accelerator keys
You can assign an accelerator key to any option in the main menu. An accelerator key is a combination of keystrokes that invoke a function.
We have assigned accelerator keys to many menu items, following the Motif standard. Typically the accelerator key is the CTRL key and an alphanumeric key.
If you are used to a Macintosh computer, you may find the ALT key more convenient. To change the default accelerator keys to use the ALT key instead of the CTRL key, add the following resource definition to your ~/.Xdefaults1 file and restart ComposerLite:
Composer*macMenus: true
When you use this Macintosh mode, the Motif mnemonics are not available.
You can assign accelerator keys only to menu items that are indirectly attached to the main menu bar.
Customizing an accelerator key
You can assign accelerator keys to menu items that do not have accelerator keys or you can change the default accelerator keys. You do this by defining new Motif resources for each menu item you want to change.
The following sections describe the steps required to define accelerator key resources. These include:
You must specify both the accelerator and the accelerator text resources for each menu option.

Resources for defining CTRL-E as File>Exit accelerator key
Defining the menu option
For both resources, you first specify which menu option the accelerator key applies to. This specification includes the following items, in order:
The word Composer, followed by * (an asterisk)
The menu name for the option.
For example, this would be the word file for File>Exit.
See the next section, for specifics before defining the menu name.
The word Menu, followed by . (a period).
The option name, followed by a . (a period).
For example, this would be the word exit for File>Exit.
See the next section "Customizing an accelerator key," for specifics before defining the option name.
For the first resource, the next portion defines the accelerator key. Go to "Customizing an accelerator key" on page 377 for information.
For the second resource, it defines the accelerator text that appears to the right of the option name.
Selecting the menu name and option name
Defining the accelerator key
For the first resource, an accelerator key definition follows the menu option definition.
The accelerator key definition includes the following items, in order:
The word accelerator, followed by : (a colon), followed by a space.
The first key in the accelerator key combination.
The following are valid for the first key:
- Alt, Ctrl, and Shift.
- F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BackSpace, Delete, Left, Right, Up, Down, Home, End, Page_Up, Page_Down, minus, plus, slash, backslash, bracketleft, bracketright, at, question, equal, less, greater, period, comma, colon, semicolon, parenleft, parenright, underscore, dollar, percent, bar, braceleft, braceright, asterisk, grave, exclam, ampersand, numbersign, quotedbl, apostrophe, asciicircum, and asciitilde.
- If you define more than one modifier key, separate their names by spaces.
- The special marker <Key>.
- The second key in the accelerator key combination.
The following symbols are valid for the accelerator:
- the lower-case letters a through z
- the digits 0 through 9
followed by the special marker <Key>, followed by the single key identified either by name or the alphanumeric character.
If the same accelerator key is defined for two different menu items, the one that appears first in the menu hierarchy is the one selected by the first accelerator key defined.
Defining the accelerator text
For the second resource, the accelerator text follows the menu option definition. This is the text that appears to the right of the menu option.
It consists of the following items, in order:
The word acceleratorText, followed by : (a colon), followed by a space.
The text you want to display.
Examples
To change the accelerator key for the File>Exit option to be CTRL-E, you would define these two resources:
Composer*fileMenu.exit.accelerator: Ctrl<Key>e
Composer*fileMenu.exit.acceleratorText: Ctrl+E
The first resource indicates that the CTRL key is to be held while the e key is pressed. The second resource specifies that the characters Ctrl+E will be displayed to the right of the File>Exit menu option.
This next example assigns the F1 function key to create a Reduce event. The required resources are:
Composer*colorEffectMenu.Reduce.accelerator: <Key>F1
Composer*colorEffectMenu.Reduce.acceleratorText: F1
Note that since Effect>Reduce is an event, the words are initial-capped. Also notice that the entire sequence is Event>Effect>Reduce, but only the two bottom options are included.
1
The macMenus and mnemonics resources are recognized only when they are found in the ~/.Xdefaults file. All other resources can be placed in ~/.Xdefaults or in ~/Composer for personal use, or in /usr/lib/X11/app-defaults/Composer for global use. Refer to the X Window System User's Guide, Volume 3, O'Reilly & Associates.
aliasdocs@aw.sgi.com
Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company. All rights
reserved.