Remapping function keys for SAP ITSMobile

Version 1

    Verified Product Versions

    CETerm 5.7

    These instructions describe how to map keys in CETerm so that they will activate actions in the ITSMobile web page. 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.

    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.txt" 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. (attached)

    Note: The JavaScript file is provided in a zip bundle along with a readme file with instructions.

    * Download file and extract it in a fresh folder on your desktop. Detailed steps are also in the CETermITSMobile_ReadMe.txt file.

    * Copy the CETermITSMobile.txt file to "My Documents" on your device / terminal

    * Go to Session -> Configure -> Options -> Configure Scripting -> Scripts

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

    * Tap the Edit button

    * Tap Import and Select CETermITSMobile.txt

    * 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. Detailed steps on remapping keys to scripts are in this Map a key to a script

    4. Enter a small script for each key remapped in Step 3. Go to Session -> Configure -> Options -> Configure Scripting -> Scripts and remap key as shown in table below.

    KeyKey ActionScript Content
    F1Script 1setFKey( 1 );
    F2Script 2setFKey( 2 );
    F3Script 3setFKey( 3 );
    F4Script 4setFKey( 4 );
    F5Script 5setFKey( 5 );
    F6Script 6setFKey( 6 );
    F7Script 7setFKey( 7 );
    F8Script 8setFKey( 8 );// see tip 3
    F9Script 9setFKey( 9 );
    F10Script 10setFKey( 10 );
    F11Script 11setFKey( 11 );
    F12Script 12setFKey( 12 );
    EnterScript 13setOkCodeEnter();

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


    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 ITSMobileapplications.

    For example, to make F8 activate the correct action in processKeyEvent(), use this script in CETerm:

    processKeyEvent( 119, false, false );

    Note that processKeyEvent() expects the Windows virtual-key code value as the first argument.

    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 functions.

    In some cases you may need to modify the functions in CETermITSMobile.js to get the desired behavior.