Getting list of supported hardware keys in Web app

This code shows how to get list of supported hardware keys and their Code using Tizen Web API. Here hardware keys are VolumeUp, VolumeDown, BackKey etc.
  var keyCodes = {};
    var supportedKeys = tizen.inputdevice.getSupportedKeys();

    console.log('Supported keys list');
    for (var i = 0; i < supportedKeys.length; ++i) {
        keyCodes[supportedKeys[i].name] = supportedKeys[i].code;
        console.log(i + ': ' + supportedKeys[i].name + ' - ' + supportedKeys[i].code);
    }

Responses

0 Replies