The key binding sequence input field in the AWM model editor can capture valid keystroke combinations for easy configuration. Press the desired key sequences while the cursor is in the input field.
As soon as a valid keystroke (combination) has been captured, no further keys are added to the field. To change or unset a key binding, press Backspace.
Pressing the Enter key while in key capturing mode will not exit the input field, like in other fields in the model editor, because Enter can be used as part of keystroke combinations. To exit the input field, press Tab or simply click any other field or object.
For example, setting the key binding sequence Ctrl+Shift+R:
Each key binding is defined by a key sequence, a binding context, and an action. Pressing a keystroke combination will execute the corresponding action, if the binding context is active.
Binding contexts must be used to prevent conflicts with other key bindings. Since there are many existing key bindings in Visual COBOL, a lot of actions share the same key sequence, for example Find/Replace (Ctrl+F) or Delete (Delete). Most of the time, key bindings are connected to UI components like views or dialogs. These components define their own binding context, which is only active if the specific view or dialog is focused.
AWM defines its own set of binding contexts:
All AWM views
All AWM views displaying modeled elements
Binding contexts can have a parent/child hierarchy, meaning that each context can contain other contexts or vice versa. All AWM binding contexts are contained in the standard Eclipse binding context In Windows, which is always active. Click to see a list of active bindings.
Examples:
If an action descriptor is used in a global faction (see Global Action for more information) and a key binding is desired, you should set the binding context to, for example, In Windows, so that the action can be executed by a keystroke combination when no AWM Views are focused.
If more than one key sequence is configured and active due to the same binding context, a key binding conflict will occur. This can be intentional, a selection dialog pops up automatically at the bottom right of the screen, in which the desired action can be chosen manually, see the image below:
Due to the way Eclipse handles key bindings, there can be situations where a binding conflict cause certain actions not to be executable via keystrokes. The reason is that Eclipse always prioritizes actions with non-conflicting bindings.
Three actions are bound to the key “Delete”.
Because actions 2 and 3 share the same context, they cause a binding conflict. If a user pressed “Delete” on an AWM file element, Eclipse would only try to execute action 1, it prioritizes the non-conflicting action above the conflicting ones.
A workaround is to merge the tools for both AWM actions into a single action. This will eliminate the conflict and cause the AWM action to be prioritized in AWM views, since they have more specific binding contexts. If necessary, tool enabled conditions can be used to only execute tools applicable for the selected element.
AWM does not currently support user customization of modeled key bindings. You can view and temporarily change modeled bindings by using the “Keys” preference page (> ). Loading an AWM model, (for example, by restarting Visual COBOL or switching between two AWM applications) will always set modeled key bindings and overwrite any custom key binding changes for affected actions.