Keyboard Mapping for Web Applications

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


NOTE:  If AID key and operation buttons are not included in a generated Web form then there will be no keyboard mapping, including a mapping for the Enter key. You can map the Enter key to a function by including a button with a width and height of 0 in the Web form and programming it for the desired functionality.

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 requires the:

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

Default Settings:

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

To modify the keyboard mapping

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

AidKey Class Constructor

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

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

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

    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)
      ));

    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
    1. 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;
    2. Set the logging setting back to False when you are finished testing.
  2. Save your changes.




 

 

  Attachmate