From AlphaWiki

Menus: User Defined Menu Shortcuts

This page gives information about how to customize the menu shortcuts in AlphaX. It explains, from the user's point of view, how one can attach a menu shortcut (aka keyboard equivalent) to a menu item, change an existing shortcut or restore the original one. The information below is intended for users: developers who are interested in providing support for user-defined menu shortcuts in their package should read the Alpha Menu Shortcuts page on this wiki.

Starting with version 8.2a1d5, AlphaX offers a new interface to define menu shortcuts. Graphically it is very similar to the previous system, but internally it is based on the new menus and bindings mechanism. It is even possible to assign composite bindings la emacs (see the Bindings Quick Start page on this wiki).

Menu shortcuts customization is a per-package feature. This means that not all menus offer the possibility of assigning or customizing shortcuts but most of them do. This includes:

The user shortcuts interface

Some of the packages mentioned above provide somewhere a menu item named "Menu Shortcuts", or "Assign Menu Shortcuts", or something similar. For instance, the shortcuts of the basic menus can be assigned via the command Menu Shortcuts found in the ''Keyboard Shortcuts submenu of the Config'' menu.

Menu packages like the Electric menu, the Filters menu, etc. also have such an item. On the contrary, some packages do not expose a "Menu Shortcuts" command of their own but rely on another package to provide this functionnality. This is essentially the case of the packages which insert a submenu in one of the basic menus: they use the same command as the basic menus themselves.

Setting a menu shortcut is done in a preferences dialog invoked when one selects the appropriate Menu Shortcuts command: this dialog displays a list of all the menus or submenus whose shortcuts are configureable. One must first select a menu or submenu, then click on one of the two buttons located next to the list:

Click on the Close button when you are finished with the ''Menu Shortcuts'' dialog. Normally you should see the newly defined shortcuts in the corresponding menu or submenu (see the Troubleshooting section if this is not the case).

Troubleshooting

Beware that some packages define mode-specific bindings rather than global bindings: this is the case of the mode menus, like the LaTeX menu, the HTML menus, the Postcript menu, etc. Mode specific bindings are displayed in the menus only if the currently opened window is edited in this mode: for instance, if you define menu shortcuts in the LaTeX menu, these shortcuts will be displayed in the menu only if the current window is in TeX mode.

Some packages do not let you assign a shortcut to all the items: this is the case for instance of the Open Windows package and the Recent File package. The Windows menu maintains a list of the currently opened windows in the bottom part of the menu (and automatically assigns keyboard equivalents, Cmd-1 to Cmd-9): only the permanent items in the top part of the menu can be assigned a shortcut. The ''Open Recent submenu of the File'' menu maintains a list of the most recent files edited in Alpha in the top part of the menu: only the permanent items in the bottom part of the menu can be assigned a shortcut.

In the case of composite bindings, if a prefix is not present in the list displayed by the Set Shortcut dialog, it means that no binding has been defined to link this prefix to the [prefixChar] command: you will have to define it yourself. See the Bindings Quick Start page on this wiki.

Retrieved from http://alphatcl.sourceforge.net/wiki/pmwiki.php/Menus/UserDefinedShortcuts
Page last modified on October 12, 2007, at 05:32 AM