Wx3270/Help/Settings/Keyboard

This tab allows the wx3270 keyboard map to be edited.

Concepts
A keyboard map (keymap) maps pressing a key or keys on the keyboard onto a series of actions to execute. The default keyboard map defines common 3270 terminal operations, such as mapping the F1 key to the action PF(1) and the Tab key to the Tab action. You can override these mappings with your own.

Modifiers and precedence
Keyboards include modifier keys, such as Shift, Ctrl and Alt. These keys are held down to change the behavior of some other key, e.g., pressing Ctrl and A can have a different effect than pressing A alone.

A mapping will match if all of the modifier keys it specifies are pressed, but other modifier keys may be pressed as well. If a key matches multiple mappings, wx3270 will always match a more-specific mapping in preference to a less-specific one. For example, if there is a mapping for Ctrl-A and a mapping for A with no modifiers, then pressing Ctrl-A will match the first mapping, as will pressing Ctrl-Alt-A. However, pressing Shift-A will match the second mapping (because Ctrl is not pressed).

Soft modifiers
wx3270 also supports soft modifiers, which are software-defined modes that behave like modifiers, such as Shift Lock and Num Lock on the real keyboard. The soft modifiers are:
 * 3270 mode
 * The emulator is in 3270 mode.


 * NVT mode
 * The emulator is in NVT mode.


 * APL mode
 * The emulator is in APL mode.

Chords
A chord is a two-key sequence. Pressing and releasing the first key starts the cord. Pressing and releasing the second key completes the chord and executes the associated actions. (The 'key' can actually be a key plus modifiers.)

When the first key of a chord is pressed and released, wx3270 will wait for the second key, with an indication in the operator information area, until a timeout expires.

Key codes and scan codes
When a key is pressed on a Windows keyboard, an event with two attributes is generated. Those attributes are a key code and a scan code.

A key code is generally a symbolic name for the label on the key. For example, the key just to the right of the Tab key on an English-language keyboard is labeled Q, and the key code it generates is Q. On a French-language keyboard, this same key is labeled A, and the key code it generates is A. This mapping is controlled by the currently-selected Windows keyboard, which can be changed with the Win-Space key.

By contrast, a scan code is a hexadecimal value that represents a physical key. A scan code does not change with the Windows keyboard; it always represents the same location. For example, the English-language Q key / French-language A key has the scan code 0x10.

A wx3270 keymap entry can match on either a key code or a scan code. Which to use depends on the purpose of the key. For example, the default keymap maps Alt-A to the Attn action (the 3270 ATTN key). A is a mnemonic for ATTN, so it makes sense to map it to the A key code, wherever that key might be. By contrast, the APL mapping for that key is the ? (roll) symbol, which is generally in that location regardless of which letter it normally generates. So the default APL key mappings are based on scan codes. If a key matches both a scan code entry and a key code entry, wx3270 will prefer the scan code entry.

1. Select a cord
wx3270 supports chords, which are two-key sequences. The first key introduces the chord, while the second completes the action.

To define the actions for the second key, select the name of the first key in the combo box. To define an ordinary mapping, leave the combo box selection at None. To define a new chord, leave the selection at None and see step 5 below.

2. Select a key
Click on the keyboard icon. A key selection window will pop up, allowing you to specify the key to map.

3. Select modifiers
These checkboxes allow the modifiers to be selected. A keymap with modifiers has higher precedence (overrides) a keymap without modifiers. So for example, if there is a mapping defined for Alt-Q, it overrides a mapping for Q with no modifiers. The modifiers are:
 * Shift
 * The left or right Shift key.


 * Alt
 * The Alt key. On keyboards with an AltGr key, this is only the left Alt key. On other keyboards, this can be either Alt key.


 * Ctrl
 * The left or right Ctrl key.


 * APL
 * Apply the mapping only when in APL mode.


 * NVT only
 * Apply the mapping only when in NVT mode.


 * 3270 only
 * Apply the mapping only when in 3270 mode.

Note that it is also possible to map one of the modifier keys by itself -- pressing and releasing it without pressing another key.

4. Select match type
There are two ways to match a key.

Key code
When a key is matched by key code, the match is performed based on the Windows key code that is generated when the key is pressed. The key code generated by pressing a physical key can vary depending on the Windows keyboard that is in effect. For example, the first alphanumeric key in the upper left is labeled Q on English-language keyboards. When an English-language Windows keyboard is in effect, it generates the key code for Q, and would match a wx3270 keymap entry for Q. However, if a French-language Windows keyboard is in effect, that same physical key generates the key code for A, and would match a wx3270 keymap entry for A instead.

Scan code
A scan code is a numerical identifier for the physical key on the keyboard. When a keymap matches on scan code, it will always match the same physical key, regardless of the Windows keyboard that is in effect. The physical key labeled Q on English-language keyboards has scan code 10 (hex). If your keymap entry matches on the scan code, it will always match the same physical key, regardless of the Windows keyboard selection.

wx3270 uses scan code matching for its APL mode keymap entries.

5. Select behavior
This is where chords are created. Selecting Perform actions makes this a single-key mapping (or the second key of a chord). Selecting Start chord defines this key as the first key of a two-key chord. It can then be used in step 1 to define the second-key mappings.

6. Define actions
Displays the actions (if any) associated with the key.

If this box is blank, then there are no associated actions. If the Selected Key box on the right shows a Default input, then pressing the key will cause the displayed input character to be entered. Otherwise, pressing the key will have no effect.

If this box is not blank, it displays the actions associated with the key. There may be a label under this box saying inherited from and a key name and modifiers. If this is present, then the actions are inherited from a less-specific mapping (a mapping that has fewer modifiers specified than the selected key). You can then click on the New button to create a more-specific mapping (one that matches all of the modifiers specified) that overrides the less-specific mapping.

If this box is not blank, but there is no inherited label under it, you can press the Edit button to change the action definitions.

If this box is blank, you can press the New button to create a new mapping.

Bottom buttons

 * New
 * Creates a new key mapping, using the macro editor.


 * Edit
 * Edits an existing key mapping, using the macro editor.


 * Delete
 * Deletes the actions associated with the key.