Key Binding

Key Binding Sequence Field

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:

  1. Select the desired action descriptor in the model editor.
  2. Place the cursor in the Key Binding Sequence field in the properties view.
  3. Press and release the key combination.
    Note: The modifiers Ctrl and Shift must be pressed before R. The order in which modifiers (Ctrl, Shift, Alt) are pressed does not matter.
  4. Press Tab or click outside the input field to exit key capturing mode.

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:

  • AWM Views

    All AWM views

    • AWM Team Developer Element View

      All AWM views displaying modeled elements

      • AWM Team Developer Table View
      • AWM TeamDeveloper Tree View

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 Window > Preferences > General > Keys to see a list of active bindings.

Examples:

  • Setting the binding context AWM Team Developer Element Views will activate a key binding both for the Application Explorer view and the Table Results view.
  • Setting the binding context AWM Team Developer Tree View will activate a key binding only for the Application Explorer view.

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.

Binding conflicts

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.

Example:

Three actions are bound to the key “Delete”.

  1. “Delete” standard Eclipse action.
    • Context: “In Windows"
  2. “Delete File” AWM action.
    • Context: “AWM Team Developer Element Views"
  3. “Delete Folder” AWM action.
    • Context: “AWM Team Developer Element Views"

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.

User Customization

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 (Window > Preferences>General > Keys). 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.