Skip to content

Keyboard Maps

You can map your keyboard so specific workstation keyboard keys will function as terminal keys for a host application. Keyboard mapping is available for Web applications.

You can implement keyboard mapping after a project is built, or incorporate it into a User-Defined Project Type, which you can use to build subsequent Web applications using the same keyboard map.

Keyboard mapping requirements

Each time you build a Web application using these settings a default keyboard mapping is generated for 3270 and 5250 keyboards.

Keyboard mapping requires the:

  • Host Integrator model to be connected to either a 3270 or 5250 terminal
  • Client has JavaScript enabled
  • Terminal option selected for the screen display
  • Enable option selected for the Aid key settings

Default settings

Keyboard key 3270 Terminal Key 5250 Terminal Key
F1-F12 PF1-PF12 PF1-PF12
Shift + F1-F12 PF13-PF24 PF13-PF24
Scroll lock Clear Clear
Escape Reset Reset
Ctrl-Enter Enter Enter
Page Up PA1 Page Up
Page Down PA2 Page Down
KP Minus (5250) n/a Field Minus
KP Plus (5250) n/a Field Plus

When visible, the Aid keys have automatically generated tooltips that show the keyboard mapping.

Modify the Keyboard Mapping

Use the following information to edit the keyboard mapping for 3270 or 5250 host applications:

AidKey Class Constructor

  • aidKey— The AidKey3270/5250.Codes enumeration to map to the terminal key
  • key— The local keyboard Key.Codes enumeration to map to the terminal key
  • keyModifier— The local keyboard Key.Modifiers enumerations are required when mapping the local key. The single modifier Key.Modifiers.SHIFT requires only the Shift key to be pressed. Multiple Key.Modifiers.SHIFT|Key.Modifiers.CTRL requires the Shift and Control keys to be pressed.

Using keyboard.js

The keyboard.js file defines the local keyboard code enumeration, Key.Codes, and the modifier key, Key.Modifiers:

Key.Modifiers = {
        NONE: 0,
        ALT:  1,
        CTRL:  2,
        SHIFT:  4,
        META:  8  //Windows or Apple Command keys
};

Key.Codes = {
        ESCAPE:  27,   //ESC
        F1:  112,
        F2:  113,
        F3:  114,
        F4:  115,
        F5:  116,
        F6:  117,
};
Using aidkeys_3270.js and aidkeys_5250.js

Both the aidkeys_3270.js and aidkeys_5250.js define the aidKeysxxxx. Codes as well as the mapping between the Aid keys and the local keyboard.

AidKey3270.Codes = {
        ATTN: 257,
        CLEAR:  277,
        SYSRQ:  504,
        RESET:  393,
};

To edit your keyboard mapping configuration

Open aidkeys_3270.js or aidkeys_5250.js (depending on your terminal type), in a text or JavaScript editor.

  • To modify a key

    Find the entry in the Keyboard3270 or Keyboard5250 constructor. new AidKey(AidKey3270.Codes.PF1, Key.Codes.F1, Key.Modifiers.NONE) Modify the key or keyModifier parameter as needed. new AidKey(AidKey3270.Codes.PF1, Key.Codes.F1, Key.Modifiers.ALT)

  • To add a key

    At the end of the Keyboard3270 or Keyboard5250 constructor, add a new entry.

    new AidKey (AidKey3270.Codes.PA2, Key.Codes.PAGE_DOWN, Key.Modifiers.NONE),
    new AidKey (AidKey3270.Codes. SYSRQ, Key.Codes.PGUP, KeyModifiers.SHIFT)
    ));
    

  • To remove a key

    Remove the line that contains the Aid key you want to remove. For example, change this:

       new AidKey (AidKey3270.Codes.PF23, Key.Codes.F11, Key.Modifiers.SHIFT),
       new AidKey (AidKey3270.Codes.PF24, Key.Codes.F12, Key.Modifiers.SHIFT),
       new AidKey (AidKey3270.Codes.PA1, Key.Codes.PAGE_UP, KeyModifiers.NONE)
    

    To this:

       new AidKey(AidKey3270.Codes.PF23, Key.Codes.F11, Key.Modifiers.SHIFT),
       new AidKey (AidKey3270.Codes.PA1, Key.Codes.PAGE_UP, KeyModifiers.NONE)
    
    - Troubleshoot a problem

    Edit the browser.js file by setting the logging settings, located near the beginning of the file, to True.

    var LOGGER = true;

      var ERROR = true;`
      var WARN = true;
      var INFO = true;
      var DEBUG = true;
      var TRACE = true;
    
    Set the logging setting back to False when you are finished testing.