CETerm: Remapping Keys for SAP ITSMobile

Version 2

    Verified Product Versions

    Wavelink Naurtech CETerm 5.7

    Applies to: CETerm, CE3270, CE5250, CEVT220

     

    Symptom

    User needs to remap keys to work with HTML page output generated by SAP ITSMobile applications.

     

    Resolution

    These instructions describe how to map keys in CETerm so that they will activate actions in the ITSMobile web page. Although this article references CETerm, these same steps are applicable to our single emulation products CE3270, CE5250 and CEVT220 also.

    These techniques are only required on a Windows Mobile device because CETerm on Windows CE devices natively supports ITSMobile key actions.  However, these techniques may also be useful on a Windows CE device to tailor the behavior for special cases.

    In general, function keys in CETerm are mapped to activate CETerm scripts.  The CETerm scripts examine the current HTML page and submit the page to the host.  The page is examined to determine if a submit is already in progress.  Later versions of ITSMobile have a more robust technique for preventing multiple submits.

    Key Mapping
    There are 4 steps to configure the CETerm key mapping:

    1. On Windows Mobile OS platform devices, check they option "Disable Windows Action Keys" on the tab:

    Session -> Configure -> Options -> Configure Keybars and Keys  -> Select Keymap
      

    This prevents the Windows Mobile OS shell from intercepting some keys such as F1, F6, and F7.

    2. Import the script "CETermITSMobile.js" into CETerm and mark it "Load at Startup".  This can be imported into any available slot, but it may be best to put it in "Script 15" to avoid conflicts with Step 4.

    Attachment:  CETermITSMobile_js.txt

    Note: This is a JavaScript file but provided here with a .txt extension for review. You can also download this and import it into CETerm on your device.

    2.1 Download CETermITSMobile_js.txt and copy it on to your device / terminal
        
    2.2 Go to  Session -> Configure -> Options -> Configure Scripting -> Scripts

    2.3
    Highlight script slot 15 (or which ever slot you would like to import the script)

    2.4 Tap the Edit button

    2.5 Tap Import and Select CETermITSMobile_js.txt

    2.6 Enable "Load at Startup"


    3. Remap function (or other) keys in the "HTML Keymap" of CETerm to run scripts with the Action: "Script xx". Configuration details are under

    Session -> Configure -> Options -> Configure Keybars and Keys -> Edit Keymap -> HTML Keymap

    Details steps on remapping keys are in article CETerm: Custom remapping hardware keys

    4. Enter a small script for each key remapped in Step 3.

    Session -> Configure -> Options -> Configure Scripting -> Scripts

    Here is a sample table for Steps 3 and 4 above.

    Key      Key Action         Script Content
    F1        Script 1             setFKey( 1 );
    F2        Script 2             setFKey( 2 );
    F3        Script 3             setFKey( 3 );
    F4        Script 4             setFKey( 4 );
    F5        Script 5             setFKey( 5 );
    F6        Script 6             setFKey( 6 );
    F7        Script 7             setFKey( 7 );
    F8        Script 8             setFKey( 8 );  // see tip 3
    F9        Script 9             setFKey( 9 );
    F10      Script 10          setFKey( 10 );
    F11      Script 11          setFKey( 11 );
    F12      Script 12          setFKey( 12 );
    Enter   Script 13          setOkCodeEnter();

                    5. Hit OK all the way out and test your remapped keys.


    Tips

    1.
    CETerm is basically simulating the "processKeyEvent()" method found in "mobile.js" or "mobile_menu.js" because under Windows Mobile, some key events are not generated.

    2. If you want another key action, look for the behavior in "mobile.js" or "mobile_menu.js" on your SAP server and assign a CETerm key and script with the same behavior.

    3. Some users may find that actions in mobile.js and mobile_menu.js are different for the same key.  In this case you can have CETerm directly call "processKeyEvent()" to work for multiple ITSMobile applications.
      
    For example, to make F8 activate the correct action in processKeyEvent(), use this script in CETerm:
      
         processKeyEvent( 119, false, false );

    4. The key actions and scripts are listed in order in the table above, but there is no requirement to use these script slots.  Any script slot can be used and the key re-mapped to activate the selected slot.  For example, F9 could be mapped to Action "Script 23" and Script 23 could contain "setFKey( 9 );".

    5. Do *not* mark any of the key action scripts "Load at Startup".

    6. Be sure to put all key mappings into the "HTML Keymap".

    7. We have observed several variations of the ITSMobile HTML and JavaScript on different systems, so you may need to try several options to find the best mapping for your system.
      
    The best approach is to review the "mobile.js" or "mobile_menu.js" scripts used by the page and select the corresponding actions in the CETermITSMobile_js.txt functions.
      
    In some cases you may need to modify the functions in CETermITSMobile_js.txt to get the desired behavior.

    8. Make sure on the "Select Keymap" tab that you have checked "Emulation" for "Session Keymap Type" and "Include Common Map"

     

    Additional Information

    None