Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

X96Max 4/64 adding keys to the remote.tab files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    X96Max 4/64 adding keys to the remote.tab files

    I need some help to understand the correct way to add keys to the IR remote config files.
    I have a programmable RCA Media-center remote. I have programed it to control Kodi, WMC, Plex all using one device setup it works great on my windows PC.
    I now added my android TV box X96max to it and programed all the keys from the remote that came with the TV box. But find that remote lacks many keys like stop, jump back/forward, page up/down to name a few i would like to add to the remote config files of Android. I know i could edit the keymap in kodi but i would like to just do it once have it work for most apps that could use the extra buttons.

    On this box there is no remote.conf file in system/etc
    but i do have remote.cfg remote.tab1 remote.tab2 remote.tab3 in the system/vendor/etc

    So am i to edit remote.tab2 or create and add a remote.conf

    I notice in the remote.tab2 file they assign hex to a android key command it looks like. but it is not clear how you come up with the hex value or if i can pick any unused hex value and assign it.
    I see that the IR remote buttons they have setup in remote.tab2 mostly match the key command numbers from the Generic.kl file and they assigned a hex value to it but notice the hex value jumps around and is not in sequence.

    Code:
    remote.tab2
            0x41 113  #MUTE
            0x18 115  #VOLUMEUP
            0x10 114  #VOLUMEDOWN
    
    
    Generic.kl
    key 113   VOLUME_MUTE
    key 114   VOLUME_DOWN
    key 115   VOLUME_UP

    i read the tutorial here
    But it seem the link is broken in the remote.conf section where is says "A full description on how to generate your own remote.conf file..."


    So if i could get some guidance that would be great maybe i could do it right the first time and not keep guessing,
    Thanks

    #2
    Its bit more complicated. Both the remote.* (or similar dts binding) and keyboard layout (*.kl) play two very important roles. When you hit the key on your IR, it sends a NEC1 coded message.Kernel driver using remote.* or dts binding converts this to scancode, and send it to the Android input layer. Android input layer looks this scan code up in the keyboard layout files (*.kl) to convert that to some useful function.

    Layout of remote.conf (or remote.tabX) is,
    Code:
    <NEC1 OBC code> <scan code>
    Anything followed by # is ignored as comments
    For example when you hit UP arrow on your remote, it send the signal in NEC1 format with OBC code of 0x16. This gets converted to scancode of 103 by the following line,
    Code:
    0x16 103  #UP
    Now this 103 get converted to actual UP keycode by keyboard layout. In /vendor/usr/keylayout/Vendor_0001_Product_0001.kl you have,
    Code:
    key 103   DPAD_UP
    Which instructs Android input layer to convert scancode of 103 to DPAD UP key.

    I just finished adding new keys to my remote. But for that you need to,
    1. To be able to send custom OBC codes from your remote. This is not something that your remote can learn, since original remote does not send these codes.
    2. Once you pick a custom code to send, you'd need to copy /vendor/cfg/remote.tab2 to /vendor/cfg/remote.conf and add that line to it. Use one of the standard Linux scan codes from https://github.com/torvalds/linux/bl...-event-codes.h
    3. Then add a corresponding entry to /vendor/usr/keylayout/Vendor_0001_Product_0001.kl to convert this scan code to something useful.
    (Note: there is a bug in my X96Max firmware, it does not load remote.conf automatically. I had to change one of the rc files)

    I just finished adding some extra keys to my remote. But my remote is JP1 capable, so adding new codes is quite easy.

    Comment


      #3
      Originally posted by chish View Post
      Its bit more complicated. Both the remote.* (or similar dts binding) and keyboard layout (*.kl) play two very important roles. When you hit the key on your IR, it sends a NEC1 coded message.Kernel driver using remote.* or dts binding converts this to scancode, and send it to the Android input layer. Android input layer looks this scan code up in the keyboard layout files (*.kl) to convert that to some useful function.

      Layout of remote.conf (or remote.tabX) is,
      Code:
      <NEC1 OBC code> <scan code>
      Anything followed by # is ignored as comments
      For example when you hit UP arrow on your remote, it send the signal in NEC1 format with OBC code of 0x16. This gets converted to scancode of 103 by the following line,
      Code:
      0x16 103 #UP
      Now this 103 get converted to actual UP keycode by keyboard layout. In /vendor/usr/keylayout/Vendor_0001_Product_0001.kl you have,
      Code:
      key 103 DPAD_UP
      Which instructs Android input layer to convert scancode of 103 to DPAD UP key.

      I just finished adding new keys to my remote. But for that you need to,
      1. To be able to send custom OBC codes from your remote. This is not something that your remote can learn, since original remote does not send these codes.
      2. Once you pick a custom code to send, you'd need to copy /vendor/cfg/remote.tab2 to /vendor/cfg/remote.conf and add that line to it. Use one of the standard Linux scan codes from https://github.com/torvalds/linux/bl...-event-codes.h
      3. Then add a corresponding entry to /vendor/usr/keylayout/Vendor_0001_Product_0001.kl to convert this scan code to something useful.
      (Note: there is a bug in my X96Max firmware, it does not load remote.conf automatically. I had to change one of the rc files)

      I just finished adding some extra keys to my remote. But my remote is JP1 capable, so adding new codes is quite easy.
      Thank you

      That was what i was missing about adding the convert code in Vendor_001... I did not understand how it worked so i was guessing.
      I do have a JP1 Remote and cable to program it and i understand what you are saying as that is what i was trying to do but only edited the remote.tab2 file and got no ware.

      I now have a game plan but just need to find the time to play with it again.

      Comment

      Working...
      X