Access Keys and Keyboard Shortcuts
As an alternative to mouse access to features on the user interface, you can specify various combinations of keys to enable users to access features by means of the keyboard.
Access keys
Access keys are keys that can be used in conjunction with the Alt key. For
menu items, dialog tabs, and various other dialog controls, you can specify access keys through the
use of the mnemonic
attribute of the following elements.
Feature | Element | See... |
---|---|---|
Screen action (e.g. for a menu item) |
action
|
Actions |
Menu |
menu
|
Menus |
Dialog tab |
tab
|
Tabs |
Controllers | Various | Controllers |
For example, consider the following menu.
To specify access keys for this menu you would use the following code:
<Actions>
<Action id="generateSelect" label="Select Node..." labelKey="generate.selectNode.LABEL"
imagePath="images/generate.gif" description="Generates a select node"
descriptionKey="generate.selectNode.TOOLTIP" mnemonic="S" />
<Action id="generateDerive" label="Derive Node..." labelKey="generate.deriveNode.LABEL"
imagePath="images/generate.gif" description="Generates a derive node"
descriptionKey="generate.deriveNode.TOOLTIP" mnemonic="D" />
...
</Actions>
This gives you underscore characters on the menu items.
Users can now access the menu items by means of Alt-S and Alt-D, as well as clicking them with the mouse.
Shortcut keys
Shortcut keys are key combinations that enable end users to navigate around the user interface. IBM® SPSS® Modeler provides a number of keyboard shortcuts as standard. In CLEF, you can add shortcuts only for custom menu items that you have added.
For example, to specify shortcuts for items on the menu shown in the access keys example, you would use the following code:
<Actions>
<Action id="generateSelect" label="Select Node..." labelKey="generate.selectNode.LABEL"
imagePath="images/generate.gif" description="Generates a select node"
descriptionKey="generate.selectNode.TOOLTIP" mnemonic="S" shortcut="CTRL+SHIFT+S" />
<Action id="generateDerive" label="Derive Node..." labelKey="generate.deriveNode.LABEL"
imagePath="images/generate.gif" description="Generates a derive node"
descriptionKey="generate.deriveNode.TOOLTIP" mnemonic="D" shortcut="CTRL+SHIFT+D" />
...
</Actions>
The shortcut key combinations are now added to the menu items.
Users can now access the menu items by means of the keyboard shortcuts, as well as clicking them with the mouse. You can specify shortcut keys in conjunction with access keys, as in this example.
Take care not to use shortcuts that have already been specified on the same dialog, or any of the standard IBM SPSS Modeler shortcuts.