Customizing the keyboard

You can easily customize the function of the keyboard.

To customize the keyboard functions, select Window > Preferences > General > Keys. The Keys preference page opens. On this page you can assign key strokes and key sequences to start particular commands offered by the various plug-ins. Host Connection Emulator provides several standard commands such as [attn], [clear], [enter], [newline], and [pf1]-[pf24]. Each of these standard commands can be assigned to key sequences. The following topics explain how keyboard customization is implemented.

Key strokes, key sequences, and key bindings

A key stroke is the act of pressing a key and including any of the modifier keys such as Ctrl, Alt, Shift, or Command. For example,Ctrl+S is the key stroke obtained by holding down the Ctrl key and pressing the S key. Similarly S is the key stroke obtained by pressing the S key. A key sequence is an ordered set of one or more key strokes. Finally, a key binding is the assignment of a key sequence to a particular command. You can view and modify all key bindings on the Keys preference page.

Note: The [enter] command is no longer sent to the remote system when the Ctrl key is pressed. This case holds when using a Ctrl key combination and when only the Ctrl key is pressed. To send the [enter] command to the remote system, use the Enter key.

Schemes, categories, and contexts

A scheme is a set of bindings. A Default scheme is included and the Emacs scheme, which extends the Default scheme. The Default scheme contains a general set of common key sequences for well-known commands. Similarly, the Emacs scheme contains a set of key bindings familiar to users of Emacs.

A category is a way of grouping commands. For example Text Editing is a category in Eclipse. For the Host Connection Emulator feature a Host Connect category is defined. All commands available for the Host Connection Emulator feature are listed under the Host Connect category.

A context defines the active part of Eclipse. Key bindings can vary according to the current context of Eclipse. Sometimes the active part can be a Java™ editor and at other times it can be the Host Connection Emulator. For example, in most contexts the F1 key opens the Eclipse Help view but the Host Connection Emulator context overrides this behavior and sends the [pf1] command to the remote system. You can view the bindings, category, and context that you want on the Keys preference page.

Viewing and modifying key bindings

All key bindings can be viewed and modified from the Keys preference page. Key bindings are viewed in table format with columns for the Category, Command, Key Sequence, and When (Context). The table can be sorted by any of these values. The Host Connection Emulator plug-in has default key bindings to override existing Eclipse key bindings (such as F1).

The Keys preference page displays the set of defined key bindings.

Use the Keys preference page to customize the set of key bindings.

The Keys preference page shows how key bindings are customized. In the first section titled Command, you can select the Binding, Category, and Name field values for the command by using the first three lists. If the command you select has any existing key bindings, they are listed in the Assignments table with the context when the key binding is applicable and the key sequence that activates the command. The lower section of the page is used to add or remove key bindings from the set of assignments for the currently selected category and command. The Name field in this section is used to input the key sequence. The field is specially modified to display a human-readable sequence of key strokes. The Assignments table indicates all key bindings that are currently set for the key sequence.

To remove a key binding:
  1. Enter a key sequence in the Name field.
  2. Select a command listed in the Assignments table.
  3. Click Remove.

You can undo the operation by clicking Restore.

To add a key binding:
  1. Select the category, and command by using the Category and Name lists. Select the Defaults and the Host Connection Emulator category to view the available set of commands for the Host Connection Emulator plug-in.
  2. Enter a key sequence in the Name field.
  3. Select a context from the When list. Select In Host Connection Emulator for the Host Connection Emulator plug-in.
  4. Click Add.

The new key sequence is added to the Assignments table of the Command section for the currently selected binding, category and command.

For more information about using the Keys preference page, see the Eclipse help documentation.


Feedback