Apple TV 4K - Kodi custom keymap for the SiriRemote
#16
Hi @fernmac,

what did you configure differently than me? I am always interested in optimizing my Keymap. Wink

Regards Hoppel
frontend: nvidia shield tv 2019 pro | apple tv 4k | sonos arc 5.1.2 | lg oled65c97la
backend: supermicro x11ssh-ctf | xeon | 64gb ecc | wd red | zfs raid-z2 | dd max s8

software: debian | proxmox | openmediavault | docker | kodi | emby | tvheadend | fhem | unifi
Reply
#17
Hi hoppel118,
I'm trying to fetch xml file, but link is empty. Could you please check?

Thank you

Jiri
Reply
#18
Hm..., I don't know what happened to the pasted files.

Here ist my one I use at the moment:

xml:


<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the mapping of keys (gamepad,remote and keyboard) to actions within XBMC -->
<!-- The <global> section is a fall through - they will only be used if the button is not        -->
<!-- used in the current window's section.  Note that there is only handling                     -->
<!-- for a single action per button at this stage.                                               -->
<!-- For joystick/gamepad configuration under linux/win32, see below as it differs from xbox     -->
<!-- gamepads.                                                                                   -->

<!-- The format is:                                                                              -->
<!--    <device>                                                                                 -->
<!--      <button id=""#>xbmc action</button>
<!--    </device>                                                                                -->

<!-- To map keys from other remotes using the RCA protocol, you may add <customcontroller name="SiriRemote"> blocks -->
<!-- In this case, the tags used are <button id=""#> where # is the original button code (OBC) of the key -->
<!-- You set it up by adding a <customcontroller name="SiriRemote"> block to the window or <global> section:        -->
<!--    <customcontroller name="SiriRemote">                                                                        -->
<!--       <button id="45">Stop</button>
<!--    </customcontroller>                                                                       -->

<!-- Note that the action can be a built-in function.                                            -->
<!--            eg <button id="6">ActivateWindow(Favourites)</button>
<!-- would bring up Favourites when the button with the id of 6 is press. In this case, "Menu"   -->

<!--                                                                                             -->
<!--  Button Ids:                                                                                -->
<!--  'id' is the button ID used by SDL. The key ids recognized from your remote appears      -->
<!--  in /var/log/syslog on the ATV2 for each button pressed and when debug mode is enabled      -->
<!--  Use your log to discover and map custom buttons to actions.                                -->

<keymap>
  <global>
    <customcontroller name="SiriRemote">
      <!-- up --> <button id="1">Up</button>
      <!-- down --> <button id="2">Down</button>
      <!-- left --> <button id="3">Left</button>
      <!-- right --> <button id="4">Right</button>
      <!-- center --> <button id="5">Select</button>
      <!-- menu -->      <button id="6">Back</button>
      <!-- hold center --> <button id="7">ContextMenu</button>
      <!-- swipe up --> <!-- <button id="8">FirstPage</button> -->
      <!-- swipe down --> <!-- <button id="9">LastPage</button> -->
      <!-- swipe left --> <!-- <button id="10">PageUp</button> -->
      <!-- swipe right --> <!-- <button id="11">PageDown</button> -->
      <!-- play/pause --> <button id="12">PlayPause</button>
      <!-- ir play --> <button id="13">Play</button>
      <!-- ir pause --> <button id="14">Pause</button>
      <!-- ir stop --> <button id="15">Stop</button>
      <!-- ir next track --> <button id="16">SkipNext</button>
      <!-- ir prev track --> <button id="17">SkipPrevious</button>
      <!-- ir fast forward --> <button id="18">FastForward</button>
      <!-- ir rewind --> <button id="19">Rewind</button>
    </customcontroller>
  </global>
  <Home>
    <customcontroller name="SiriRemote">
      <button id="6">FullScreen</button>
    </customcontroller>
  </Home>
  <FullscreenVideo>
    <customcontroller name="SiriRemote">
      <button id="1">Up</button>
      <button id="2">Down</button>
      <button id="3">StepBack</button>
      <button id="4">StepForward</button>
      <button id="5">OSD</button>
      <button id="6">Back</button>
      <button id="7">Info</button>
      <button id="8">AudioNextLanguage</button>
      <button id="9">NextSubtitle</button>
      <button id="10">CodecInfo</button>
  </customcontroller>
  </FullscreenVideo>
  <FullscreenLiveTV>
    <customcontroller name="SiriRemote">
      <button id="1">Up</button>
      <button id="2">Down</button>
      <button id="3">StepBack</button>
      <button id="4">StepForward</button>
      <button id="5">OSD</button>
      <button id="6">Back</button>
      <button id="7">ActivateWindow(TVGuide)</button>
      <button id="8">AudioNextLanguage</button>
      <button id="9">NextSubtitle</button>
      <button id="10">CodecInfo</button>
    </customcontroller>
  </FullscreenLiveTV>
  <FullscreenRadio>
    <customcontroller name="SiriRemote">
      <button id="1">Up</button>
      <button id="2">Down</button>
      <button id="3">StepBack</button>
      <button id="4">StepForward</button>
      <button id="5">OSD</button>
      <button id="6">Back</button>
      <button id="10">CodecInfo</button>
    </customcontroller>
  </FullscreenRadio>
  <Visualisation>
    <customcontroller name="SiriRemote">
      <button id="9">SkipPrevious</button>
      <button id="8">SkipNext</button>
      <button id="6">Fullscreen</button>
      <button id="7">OSD</button>
    </customcontroller>
  </Visualisation>
  <SlideShow>
    <customcontroller name="SiriRemote">
      <button id="1">ZoomIn</button>
      <button id="2">ZoomOut</button>
      <button id="3">PreviousPicture</button>
      <button id="4">NextPicture</button>
      <button id="6">Stop</button>
      <button id="7">Info</button>
    </customcontroller>
  </SlideShow>
  <ScreenCalibration>
    <customcontroller name="SiriRemote">
      <button id="5">NextCalibration</button>
    </customcontroller>
  </ScreenCalibration>
  <VideoOSD>
    <customcontroller name="SiriRemote">
      <button id="7">Back</button>
    </customcontroller>
  </VideoOSD>
  <VideoMenu>
    <customcontroller name="SiriRemote">
      <button id="5">Select</button>
      <button id="7">OSD</button>
    </customcontroller>
  </VideoMenu>
  <MyVideoLibrary>
    <customcontroller name="SiriRemote">
      <button id="7">Info</button>
    </customcontroller>
  </MyVideoLibrary>
  <MyVideoFiles>
    <customcontroller name="SiriRemote">
      <button id="7">Info</button>
    </customcontroller>
  </MyVideoFiles>
  <PictureInfo>
    <customcontroller name="SiriRemote">
      <button id="3">Left</button>
      <button id="4">Right</button>
    </customcontroller>
  </PictureInfo>
</keymap>

Have fun! Wink

Regards Hoppel
frontend: nvidia shield tv 2019 pro | apple tv 4k | sonos arc 5.1.2 | lg oled65c97la
backend: supermicro x11ssh-ctf | xeon | 64gb ecc | wd red | zfs raid-z2 | dd max s8

software: debian | proxmox | openmediavault | docker | kodi | emby | tvheadend | fhem | unifi
Reply
#19
Question for Hoppel: How are you configuring playback to continue when you switch out of full screen video? I use a separate keymap for my universal remote, and I would like to incorporate that feature. I’ve been over your XML and I don’t see how it’s done.

EDIT: I see now; switching button 6 from "stop" to "back" does the trick. Thanks for sharing your keymap!
Reply
#20
(2019-01-25, 02:15)corinthiancrush Wrote: EDIT: I see now; switching button 6 from "stop" to "back" does the trick. Thanks for sharing your keymap!

Yep, that’s it! Smile

Regards Hoppel
frontend: nvidia shield tv 2019 pro | apple tv 4k | sonos arc 5.1.2 | lg oled65c97la
backend: supermicro x11ssh-ctf | xeon | 64gb ecc | wd red | zfs raid-z2 | dd max s8

software: debian | proxmox | openmediavault | docker | kodi | emby | tvheadend | fhem | unifi
Reply
#21
I'm interested in playing with this but have some questions first.

1. I don't know how some button names in the xml correspond with the buttons on the remote.  Part of the problem might be that we are looking at different remotes.
Is the remote this is designed for the one shown here?  This came with ATV 4K.
Image

2. What do up down left right refer to?  What is the 'center button'?
3.  What are the buttons prefixed with 'ir '?
4.  I have Kodi in a Mac Mini attached to the TV.  An Apple TV is also attached.  If I use the remote to operate Kodi on the Mini, how do I prevent it from turning on the ATV, which will then switch the TV input to the ATV rather than the Mini?  Can the remote be used to operate both devices?

Thanks
LibreELEC 10.0.4 * ViMediaManager or TinyMediaManager | Raspberry pi 4b
Sharing media from NAS via NFS (optical out to receiver, HDMI to TV) | TV remote with CEC / Bluetooth keyboard
Reply
#22
No it can’t afaik (to your last question)

Up, down, left, right are swipes on the touch pad
Center is clicking the touch pad (pressing it until it clicks)
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#23
Thanks, I guess this won't work for me then.

But swipes appear to be different buttons:
  <!-- up --> <button id="1">Up</button>
<!-- down --> <button id="2">Down</button>
<!-- left --> <button id="3">Left</button>
<!-- right --> <button id="4">Right</button>
. . .
<!-- swipe up --> <!-- <button id="8">FirstPage</button> -->
<!-- swipe down --> <!-- <button id="9">LastPage</button> -->
<!-- swipe left --> <!-- <button id="10">PageUp</button> -->
<!-- swipe right --> <!-- <button id="11">PageDown</button> -->
LibreELEC 10.0.4 * ViMediaManager or TinyMediaManager | Raspberry pi 4b
Sharing media from NAS via NFS (optical out to receiver, HDMI to TV) | TV remote with CEC / Bluetooth keyboard
Reply
#24
Think 'actions' instead of physical buttons.
The Siri remote has very few physical buttons and the rest comes from finger behavior on the trackpad. 
On the trackpad, there is are finger touch, hold and click, coupled with where the finger went down and modified by movement (swipes).
Reply
#25
hey @hoppel118 , great job with the keymap! But one thing I don't get: how do you go back to fullscreen after sending video to background? When I simply click the video file, it asks me to start from the beginning or resume from the time that was shown before starting the video...  (using in Leila version)
Reply
#26
Thanks! Smile

I don’t know if I understand you right, but I think I know what you mean.

If I watch a movie for example, then go back to main menu and then want to get back to the fullscreen movie, I press the back button as often as needed to get back to fullscreen. Mostly two or three button presses are needed.

You are right. If you simply click the movie, you see the dialog, which asks you where to start.

Is that what you meant?

By the way: Thanks for integrating my keymap into the Leia build.

How is Leia working for you with your Apple TV?

Since you are using slack, it’s not possible for normal users to follow your discussion anymore. Wink

Regards Hoppel
frontend: nvidia shield tv 2019 pro | apple tv 4k | sonos arc 5.1.2 | lg oled65c97la
backend: supermicro x11ssh-ctf | xeon | 64gb ecc | wd red | zfs raid-z2 | dd max s8

software: debian | proxmox | openmediavault | docker | kodi | emby | tvheadend | fhem | unifi
Reply
#27
Wait, I'm still unclear what this keymap is for.  Is it just for Kodi installed on an apple tv?
LibreELEC 10.0.4 * ViMediaManager or TinyMediaManager | Raspberry pi 4b
Sharing media from NAS via NFS (optical out to receiver, HDMI to TV) | TV remote with CEC / Bluetooth keyboard
Reply
#28
Yes, it is. In the first post of the following thread you find a developer build for kodi 17:

https://forum.kodi.tv/showthread.php?tid=254201

If you are a developer have a look at this:

https://github.com/SylvainCecchetto/xbmc

There is some progress for kodi 18 on tvOS.

Regards Hoppel
frontend: nvidia shield tv 2019 pro | apple tv 4k | sonos arc 5.1.2 | lg oled65c97la
backend: supermicro x11ssh-ctf | xeon | 64gb ecc | wd red | zfs raid-z2 | dd max s8

software: debian | proxmox | openmediavault | docker | kodi | emby | tvheadend | fhem | unifi
Reply
#29
(2019-04-23, 20:16)hoppel118 Wrote: Thanks! Smile

I don’t know if I understand you right, but I think I know what you mean.

If I watch a movie for example, then go back to main menu and then want to get back to the fullscreen movie, I press the back button as often as needed to get back to fullscreen. Mostly two or three button presses are needed.

You are right. If you simply click the movie, you see the dialog, which asks you where to start.

Is that what you meant?
Yes, that was my question. Thanks! I'd have never guessed that I should press Back once again Smile Will test it tomorrow and see if it works.
 
(2019-04-23, 20:16)hoppel118 Wrote: By the way: Thanks for integrating my keymap into the Leia build.

How is Leia working for you with your Apple TV?

Since you are using slack, it’s not possible for normal users to follow your discussion anymore. Wink

Well, all the basic functionality seems to work already (at least I only use zeroconf/smb to add my Mac and play its videos). But binary addons can't be added yet, that's something on our roadmap.

Slack isn't used so much actually Smile All the meaningful discussion is in GitHub issues: https://github.com/SylvainCecchetto/xbmc/issues
Reply
#30
(2019-04-24, 00:45)kambala Wrote: Yes, that was my question. Thanks! I'd have never guessed that I should press Back once again Smile Will test it tomorrow and see if it works.

Yes, it’s so easy. Wink

Thanks for the information. Keep up the good work.

Regards Hoppel
frontend: nvidia shield tv 2019 pro | apple tv 4k | sonos arc 5.1.2 | lg oled65c97la
backend: supermicro x11ssh-ctf | xeon | 64gb ecc | wd red | zfs raid-z2 | dd max s8

software: debian | proxmox | openmediavault | docker | kodi | emby | tvheadend | fhem | unifi
Reply

Logout Mark Read Team Forum Stats Members Help
Apple TV 4K - Kodi custom keymap for the SiriRemote0