Keyboard Accelerators and Mnemonics

Accelerators and mnemonics are short cut keyboard control mechanisms: they provide a way of selecting buttons without recourse to a mouse.

Accelerators are supported only for certain types of button in specific menu contexts: namely, Push Button and Toggle Button in Pulldown and Popup menus. An accelerator differs from a mnemonic in that a button mnemonic is effective only if the button is currently displayed. Accelerators do not have this constraint.

If a push button within a menu contains both an accelerator and a mnemonic, the mnemonic is available as a method to activate the button only if the menu has been popped or pushed onto the display; the accelerator can be used even if the menu has not been made visible. This means that accelerators can be used to provide short cuts to menu button entries without the need to display the menu.

Mnemonics take the form of a single character. This character is normally chosen to be the first character of the button label, although it can be any character within the button label. The label is displayed with the mnemonic character highlighted usually by an underscore. Type this character when the menu containing the button is displayed to effect the mnemonic short cut.

Accelerators take the form of a sequence of characters and special meta-characters. For example, the accelerator Ctrlk means that pressing key k simultaneously with the control key will activate the button. A full explanation of valid accelerator formats and meta-characters is best found by reading your OSF/Motif Programming Manual.

Associated with accelerators is the notion of Accelerator Text - this is a description of the accelerator which is appended onto the normal button label, so that the user is aware of the existence of an accelerator and is informed of how to effect the accelerator short cut.

Note that accelerators should be unique within the context of the current dialog but mnemonics need only be unique within the menu of which the button is a member. Accelerators and mnemonics take no effect if the button to which they are associated is not sensitive to user input. Sensitivity is covered within the Core Resources Panel help topic.

See also: