GEOS SDK TechDocs
|
|
3.2 Composite Links
|
3.4 Attributes
Keyboard accelerators permit the user to activate objects without the use of default activations in the specific UI. (Much of the default activations in most graphical user interfaces use the mouse, for example.) In most cases, these keyboard accelerators require the use of a modifier (the
alt
,
shift
or
ctrl
key) and another key. The keyboard accelerator may also be a function key (F10, etc.). In general, you should avoid using the
alt
key because of its special role as a keyboard mnemonic within a visual moniker (see Visual Monikers
).
Keyboard accelerators may be activated at any time; they are valid at any point within the application whether the generic object involved is being displayed currently or not. (The only exception to this is during the display of a modal dialog box, which will block input to any other part of the application.) The system will search through the generic tree for the object containing the proper key sequence. In this manner, accelerators differ from mnemonics, which are only valid for an active level. Therefore, only use keyboard accelerators for heavily utilized commands; this prevents a glut of modified keystrokes, which may confuse the user. In general, it is good practice to use the "control" key exclusively for keyboard accelerators to prevent overlapping with GEOS keyboard acclelators and mnemonics.
You can set up keyboard accelerators using the
GI_kbdAccelerator
attribute. A keyboard accelerator must contain a valid modifier such as
alt
,
shift
,
control
, or
ctrl
. You may use any alpha-numeric character as the action key for the modifier to act on. In addition to alpha-numeric characters, the action keys shown above are also available.
The specific UI has final control over how and whether a keyboard accelerator will be implemented. Currently, keyboard accelerators will only work for
GenTriggers and GenItems. In most cases, a keyboard accelerator will be displayed alongside the text for the visual moniker of an object. In OSF/Motif, keyboard accelerators are shown to the right of menu items and to the left of other items). You may add
HINT_DRAW_SHORTCUT_BELOW
on non-menu items to draw the keyboard accelerator below the object's visual moniker.
Code Display 2-14 Using a Keyboard Accelerator
@object GenTriggerClass MyTrigger = {
/* Case is ignored for keyboard accelerators. */
GI_kbdAccelerator = ctrl `R'; /* `ctrl' and `control' are both valid. */
}
/ * Other examples:
GI_kbdAccelerator = control `A';
Case is ignored for keyboard accelerators (unlike mnemonics). If you need an uppercase `A', use `shift' as a modifier.
GI_kbdAccelerator = control shift `A';
GI_kbdAccelerator = alt `z';
GI_kbdAccelerator = alt shift `Z';
GI_kbdAccelerator = ctrl shift `G';
If you know what specific keyboard set will be implemented, you can add such special characters with the @specificUI keyword, though this is discouraged.
GI_kbdAccelerator = @specificUI alt shift DELETE;
GI_kbdAccelerator = @specificUI F6; */
For information on manipulating keyboard accelerators dynamically, see Managing Keyboard Accelerators .
GEOS SDK TechDocs
|
|
3.2 Composite Links
|
3.4 Attributes