RPi2: Support for Fire TV Stick remote (Bluetooth)

Ok figured it out. I’ve had to rewrite it quite a bit due to it being detected as a remote instead of a keyboard, in particular as well as changing all the keyboard tags to remote tags I had to make these changes:

menu -> title
rewind -> reverse
fastforward -> forward
browser_home -> start
backspace -> back
browser_back -> back
play_pause -> play

I also deleted a few spurious duplicates. Here is a version of the FireTV profile 4 (the one I like) to work under OSMC:

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
  <Global>
    <remote>
      <reverse>PageUp</reverse>
      <forward>PageDown</forward>
      <start>ActivateWindow(Home)</start>
      <title>ContextMenu</title>
    </remote>
  </Global>
  <Home>
    <remote>
      <title>ActivateWindow(Favourites)</title>
    </remote>
  </Home>
  <FullscreenVideo>
    <remote>
      <title>smallstepback</title>
      <back>Stop</back>
      <reverse>Rewind</reverse>
      <forward>FastForward</forward>
    </remote>
  </FullscreenVideo>
  <VideoOSD>
    <remote>
      <title>CodecInfo</title>
    </remote>
  </VideoOSD>
  <FullscreenLiveTV>
    <remote>
      <title>ActivateWindow(pvrosdchannels)</title>
    </remote>
  </FullscreenLiveTV>
  <pvrosdchannels>
    <remote>
      <title>back</title>
    </remote>
  </pvrosdchannels>
  <MyFiles>
    <remote>
      <play>Highlight</play>
    </remote>
  </MyFiles>
  <virtualkeyboard>
    <remote>
      <title>shift</title>
      <play>enter</play>
      <reverse>backspace</reverse>
      <forward>number0</forward>
      <back>PreviousMenu</back>
    </remote>
  </virtualkeyboard>
  <Visualisation>
    <remote>
      <back>Fullscreen</back>
    </remote>
  </Visualisation>
  <Favourites>
    <remote>
      <back>Close</back>
    </remote>
  </Favourites>
  <NumericInput>
    <remote>
      <back>Close</back>
    </remote>
  </NumericInput>
  <PVROSDChannels>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDChannels>
  <PVROSDGuide>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDGuide>
  <PVROSDDirector>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDDirector>
  <PVROSDCutter>
    <remote>
      <back>Close</back>
    </remote>
  </PVROSDCutter>
  <MyTVSettings>
    <remote>
      <back>PreviousMenu</back>
    </remote>
  </MyTVSettings>
</keymap>

Just download it to an xml file and drop it in your keymaps folder. I’ve tested it and it seems to perform functionally identically to the original version of the script on a Fire TV stick, except you also have the use of the home button (that is reserved on a Fire TV to go to the Fire TV home) which acts as a Kodi home button here.

The addition of this remote.xml makes the Fire TV remote quite a nice remote to use with OSMC. The only thing I miss is the lack of a dedicated info button, although info can be obtained through the context menu on lists or the OSD during video playback.