RDKShell Key Mapping

Created on June 21, 2022


RDKShell provides a way to map key codes to different values.  Here are the steps to do so:

  1. Add a new file to the firmware (e.g. /opt/rdkshell_keymapping.json)
  2. Edit the file.  The contents of the file should be in this format
    {
    "keyMappings":
    [
    { "keyCode": 100, "mapped": { "keyCode": 50, "modifiers":["ctrl"] } },
    { "keyCode": 150, "mapped": { "keyCode": 52, "modifiers":[] } },
    ...
    ]
    }
  3. The keyCode value is the value received from the operating system and the mapped keyCode and (optional) modifiers will be the new mapped HTML/JavaScript value
  4. Save the file
  5. Edit /lib/systemd/system/wpeframework.service
  6. Add the following to the [Service] block: Environment=”RDKSHELL_KEYMAP_FILE=/opt/rdkshell_keymapping.json”
  7. Save the wpeframework.service file
  8. Restart the wpeframework service (systemctl daemon-reload; systemctl restart wpeframework) or reboot your box
  9. RDKShell will now use the key mappings specified in the .json file.  All key codes that are not mentioned in the .json file are processed by RDKShell unmodified
  10. The default key mapping file is stored in /etc/rdkshell_keymapping.json

Go To Top