Search code examples
upnpsamsung-smart-tv

Integer representation of Samsung remote keycodes


I am trying to send key codes to a samsung smart tv using UPnP. I found the list of available key codes here. But How can i represent the same in integer, because samsung wants to receive this as integer values in the UPnP services.

Thanks


Solution

  • Here you have manual way. So pressing any button on remote give you info what int value it has:

    $('body').keydown(function(event) {
      var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
      alert("You pressed: " + keyCode);
    }