Kodi Community Forum

Full Version: apple remote - problems with long press
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
long button presses don't work on my apple remote (white) in combination with my mac mini and ubuntu 10.04 , xbmc dharma.

I wan't to map "menu hold" to the "function" context menu. I've used the search function on the forum and tried everything I came across. (keymap.xml, Lircmap.xml, different locations for these files, ...)

why does some of these kepmaps work with <remote> objects and other with <joystick>? What's the difference. (neither work)

xbmc keeps seeing the long press as if it is a short press, also in the xbmc log is no difference between short / long presses.

should a long press show different in the xbmc log? Or in irw?

Does anyone has an idea or advice?
I've been trying to get this to work this afternoon, but in vain.

I'll post my configs, hope this helps?

/etc/lirc/lircd.conf
Code:
begin remote

  name  AppleRemote
  bits            8
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   24
  pre_data       0x87EE81
  gap          211982
  toggle_bit_mask 0x0
  ignore_mask 0x0000ff01

      begin codes
          VOLUP                    0x0B
          VOLDOWN                  0x0D
          BACKWARD                 0x08
          FORWARD                  0x07
          PLAY                     0x04
          MENU                     0x02
      end codes

end remote

~/.xbmc/userdata/Lircmap.xml
Code:
<lircmap>
<remote device="AppleRemote">
<select>PLAY</select>
<left>BACKWARD</left>
<right>FORWARD</right>
<up>VOLUP</up>
<down>VOLDOWN</down>
<menu>MENU</menu>
</remote>
</lircmap>

~/.xbmc/userdata/keymaps/Keymap.xml
Code:
<keymap>
    <global>
    <joystick name="AppleRemote">
        <button id="1">Up</button>                                        <!--- Up --->
        <button id="2">Down</button>                                      <!--- Down --->
        <button id="3">Left</button>                                      <!--- Left --->
        <button id="4">Right</button>                                     <!--- Right --->
        <button id="5">Select</button>                                    <!--- Play --->
        <button id="6">PreviousMenu</button>                              <!--- Menu --->
        <button id="9">Left</button>                                      <!--- Hold Left --->
        <button id="10">Right</button>                                    <!--- Hold Right --->
        <button id="11">ContextMenu</button>                              <!--- Hold Menu --->
        <button id="12">Info</button>                                     <!--- Hold Info --->
    </joystick>
    </global>

    <Home>
    <joystick name="AppleRemote">
        <button id="6">ActivateWindow(shutdownmenu)</button>              <!--- Menu --->
        <button id="11">FullScreen</button>                               <!--- Hold Menu --->
    </joystick>
    </Home>

    <MyFiles>
    <joystick name="AppleRemote">
        <button id="6">ParentDir</button>                                 <!--- Menu --->
    </joystick>
    </MyFiles>

    <MyMusicPlaylist>
    <joystick name="AppleRemote">
        <button id="6">Playlist</button>                                  <!--- Menu --->
        <button id="9">MoveItemUp</button>                                <!--- Hold Left --->
        <button id="10">MoveItemDown</button>                             <!--- Hold Right --->
        <button id="11">Delete</button>                                   <!--- Hold Menu --->
        <button id="12">XBMC.ActivateWindow(Visualisation)</button>       <!--- Hold Play --->
    </joystick>
    </MyMusicPlaylist>

    <MyMusicPlaylistEditor>
    <joystick name="AppleRemote">
        <button id="6">Playlist</button>                                  <!--- Menu --->
        <button id="9">MoveItemUp</button>                                <!--- Hold Left --->
        <button id="10">MoveItemDown</button>                             <!--- Hold Right --->
        <button id="11">Delete</button>                                   <!--- Hold Menu --->
        <button id="12">XBMC.ActivateWindow(Visualisation)</button>       <!--- Hold Play --->
    </joystick>
    </MyMusicPlaylistEditor>

    <MyMusicFiles>
    <joystick name="AppleRemote">
        <button id="6">ParentDir</button>                                 <!--- Menu --->
        <button id="10">Queue</button>                                    <!--- Hold Right --->
        <button id="12">XBMC.ActivateWindow(PlayerControls)</button>      <!--- Hold Play --->
    </joystick>
    </MyMusicFiles>

    <MyMusicLibrary>
    <joystick name="AppleRemote">
        <button id="6">ParentDir</button>                                 <!--- Menu --->
    </joystick>
    </MyMusicLibrary>

    <FullscreenVideo>
    <joystick name="AppleRemote">
        <button id="1">BigStepForward</button>                            <!--- Up --->
        <button id="2">BigStepBack</button>                               <!--- Down --->
        <button id="3">StepBack</button>                                  <!--- Left --->
        <button id="4">StepForward</button>                               <!--- Right --->
        <button id="5">Pause</button>                                     <!--- Play --->
        <button id="6">OSD</button>                                       <!--- Menu --->
        <button id="9">Rewind</button>                                    <!--- Hold Left --->
        <button id="10">FastForward</button>                              <!--- Hold Right --->
        <button id="11">Stop</button>                                     <!--- Hold Menu --->
        <button id="12">Info</button>                                     <!--- Hold Play --->
    </joystick>
    </FullscreenVideo>

    <FullscreenInfo>
    </FullscreenInfo>

    <PlayerControls>
    </PlayerControls>

    <Visualisation>
    <joystick name="AppleRemote">
        <button id="1">NextPreset</button>                                <!--- Up --->
        <button id="2">PreviousPreset</button>                            <!--- Down --->
        <button id="3">SkipPrevious</button>                              <!--- Left --->
        <button id="4">SkipNext</button>                                  <!--- Right --->
        <button id="5">pause</button>                                     <!--- Play --->
        <button id="6">XBMC.ActivateWindow(MusicOSD)</button>             <!--- Menu --->
        <button id="9">Rewind</button>                                    <!--- Hold Left --->
        <button id="10">FastForward</button>                              <!--- Hold Right --->
        <button id="11">FullScreen</button>                               <!--- Hold Menu --->
        <button id="12">Info</button>                                     <!--- Hold Play --->
    </joystick>
    </Visualisation>

    <MusicOSD>
    <joystick name="AppleRemote">
        <button id="11">stop</button>                                   <!--- Hold Menu --->
    </joystick>
    </MusicOSD>

    <VisualisationSettings>
    <joystick name="AppleRemote">
        <button id="11">stop</button>                                   <!--- Hold Menu --->
    </joystick>
    </VisualisationSettings>

    <VisualisationPresetList>
    <joystick name="AppleRemote">
        <button id="11">stop</button>                                   <!--- Hold Menu --->
    </joystick>
    </VisualisationPresetList>

    <SlideShow>
    <joystick name="AppleRemote">
        <button id="5">Pause</button>                                     <!--- Play --->
        <button id="11">ZoomNormal</button>                               <!--- Hold Menu --->
        <button id="12">ZoomIn</button>                                   <!--- Hold Play --->
    </joystick>
    </SlideShow>

    <ScreenCalibration>
    <joystick name="AppleRemote">
        <button id="5">NextCalibration</button>                           <!--- Play --->
        <button id="10">NextResolution</button>                           <!--- Hold Right --->
    </joystick>
    </ScreenCalibration>

    <GUICalibration>
    <joystick name="AppleRemote">
        <button id="5">NextCalibration</button>                           <!--- Play --->
    </joystick>
    </GUICalibration>

    <VideoMenu>
    <joystick name="AppleRemote">
        <button id="6">OSD</button>                                       <!--- Left --->
        <button id="3">Left</button>                                      <!--- Left --->
        <button id="4">Right</button>                                     <!--- Left --->
        <button id="1">Up</button>                                        <!--- Left --->
        <button id="2">Down</button>                                      <!--- Left --->
        <button id="11">Stop</button>                                     <!--- Left --->
        <button id="6">PreviousMenu</button>                              <!--- Left --->
    </joystick>
    </VideoMenu>

    <MyVideoLibrary>
    <joystick name="AppleRemote">
        <button id="6">ParentDir</button>                                 <!--- Menu --->
    </joystick>
    </MyVideoLibrary>

    <MyVideoFiles>
    <joystick name="AppleRemote">
        <button id="6">ParentDir</button>                                 <!--- Menu --->
        <button id="10">Queue</button>                                    <!--- Hold Right --->
    </joystick>
    </MyVideoFiles>

    <MyVideoPlaylist>
    <joystick name="AppleRemote">
        <button id="6">Playlist</button>                                  <!--- Menu -->
        <button id="9">MoveItemUp</button>                                <!--- Hold Left --->
        <button id="10">MoveItemDown</button>                             <!--- Hold Right --->
        <button id="11">Delete</button>                                   <!--- Hold Menu --->
    </joystick>
    </MyVideoPlaylist>

    <MyPictures>
    <joystick name="AppleRemote">
        <button id="6">ParentDir</button>                                  <!--- Menu --->
    </joystick>
    </MyPictures>
</keymap>

none of the settings work.
I've uploade xbmc.log to pastbin:
http://pastebin.com/KExpHRuJ
Did you ever get it working? I had the same issue with aluminum Apple remote and 10.10 when i tested it a while back.
First off, I'm assuming you're using an ATV (not sure if ATV1 or ATV2 makes a difference)

You need to define the long hold functions. Here's my /root/.xbmc/userdata/keymaps/keymap.xml file:
Code:
/root/.xbmc/userdata/keymaps/keymap.xml
<keymap>
  <global>
    <joystick name="AppleRemote">
      <!-- plus       -->      <button id="1">Up</button>
      <!-- minus      -->      <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">PreviousMenu</button>
      <!-- hold center-->      <button id="7">Fullscreen</button>
      <!-- hold menu  -->      <button id="8">ContextMenu</button>
      <!-- old buttons for ATV <2.2, used on OSX  -->
      <!-- hold left  -->      <button id="9">TakeScreenshot</button>
      <!-- hold right -->      <button id="10">Right</button>
      <!-- new aluminium remote buttons  -->
      <!-- play  -->           <button id="12">Play</button>
      <!-- Learned remote buttons (ATV >2.3) -->
      <!-- Play -->      <button id="70">Play</button>
      <!-- Pause -->      <button id="71">Pause</button>
      <!-- Stop -->      <button id="72">Stop</button>
      <!-- Previous -->      <button id="73">SkipPrevious</button>
      <!-- Next -->      <button id="74">SkipNext</button>
      <!-- Rewind -->      <button id="75">Rewind</button>
      <!-- Forward -->      <button id="76">FastForward</button>
      <!-- Return -->      <button id="77">OSD</button>
      <!-- Enter -->      <button id="78">ShowVideoMenu</button>
      <!-- few gestures from Apple's iPhone Remote (ATV > 2.3 ?) -->
      <!-- SwipeLeft  -->      <button id="80">Left</button>
      <!-- SwipeRight  -->      <button id="81">Right</button>
      <!-- SwipeUp  -->      <button id="82">Up</button>
      <!-- SwipeDown  -->      <button id="83">Down</button>
    </joystick>
  </global>
  <Home>
    <joystick name="AppleRemote">
      <button id="6">XBMC.ActivateWindow(Favourites)</button>
      <button id="8">ActivateWindow(shutdownmenu)</button>
    </joystick>
  </Home>
  <Favourites>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </Favourites>
  <MyPictures>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
    </joystick>
  </MyPictures>
  <MyMusicPlaylist>
    <joystick name="AppleRemote">
      <button id="6">Playlist</button>
    </joystick>
  </MyMusicPlaylist>
  <MyMusicPlaylistEditor>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
    </joystick>
  </MyMusicPlaylistEditor>
  <MyMusicFiles>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
    </joystick>
  </MyMusicFiles>
  <MyMusicLibrary>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
    </joystick>
  </MyMusicLibrary>
  <FullscreenVideo>
    <joystick name="AppleRemote">
      <button id="1">VolumeUp</button>
  <button id="2">VolumeDown</button>
      <button id="3">StepBack</button>
      <button id="4">StepForward</button>
      <button id="5">Pause</button>
      <button id="6">Stop</button>
      <button id="7">OSD</button>
      <button id="8">CodecInfo</button>
      <button id="9">TakeScreenshot</button>
      <button id="10">FastForward</button>
    </joystick>
  </FullscreenVideo>
  <FullscreenInfo>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </FullscreenInfo>
  <PlayerControls>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </PlayerControls>
  <Visualisation>
    <joystick name="AppleRemote">
      <button id="1">VolumeUp</button>
      <button id="2">VolumeDown</button>
      <button id="3">SkipPrevious</button>
      <button id="4">SkipNext</button>
      <button id="5">Pause</button>
      <button id="6">Fullscreen</button>
      <button id="7">XBMC.ActivateWindow(MusicOSD)</button>
      <button id="8">Stop</button>
    </joystick>
  </Visualisation>
<MusicOSD>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </MusicOSD>
  <VisualisationSettings>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </VisualisationSettings>
  <VisualisationPresetList>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </VisualisationPresetList>
  <SlideShow>
    <joystick name="AppleRemote">
      <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>
      <button id="8">Rotate</button>
    </joystick>
  </SlideShow>
  <ScreenCalibration>
    <joystick name="AppleRemote">
      <button id="5">NextCalibration</button>
    </joystick>
  </ScreenCalibration>
  <SelectDialog>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </SelectDialog>
  <VideoOSD>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </VideoOSD>
  <VideoMenu>
    <joystick name="AppleRemote">
      <button id="5">Select</button>
      <button id="6">Stop</button>
      <button id="7">OSD</button>
      <button id="8"/>
    </joystick>
  </VideoMenu>
  <OSDVideoSettings>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </OSDVideoSettings>
  <OSDAudioSettings>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </OSDAudioSettings>
  <VideoBookmarks>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </VideoBookmarks>
  <MyVideoLibrary>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
      <button id="7">Info</button>
    </joystick>
  </MyVideoLibrary>
  <MyVideoFiles>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
      <button id="7">Info</button>
    </joystick>
  </MyVideoFiles>
  <MyVideoPlaylist>
    <joystick name="AppleRemote">
      <button id="6">Playlist</button>
    </joystick>
  </MyVideoPlaylist>
  <VirtualKeyboard>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </VirtualKeyboard>
  <ContextMenu>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </ContextMenu>
  <FileStackingDialog>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </FileStackingDialog>
  <MusicInformation>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </MusicInformation>
  <MovieInformation>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </MovieInformation>
  <PictureInfo>
    <joystick name="AppleRemote">
      <button id="3">Left</button>
      <button id="4">Right</button>
      <button id="6">Close</button>
    </joystick>
  </PictureInfo>
  <AddonBrowser>
    <joystick name="AppleRemote">
      <button id="6">ParentDir</button>
    </joystick>
  </AddonBrowser>
  <AddonInformation>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </AddonInformation>
  <AddonSettings>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </AddonSettings>
  <TextViewer>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </TextViewer>
  <NumericInput>
    <joystick name="AppleRemote">
      <button id="6">Close</button>
    </joystick>
  </NumericInput>
</keymap>

Note that in the <global> <joystick> section button ids 7 and 8 are defined as "hold center" and "hold menu" respectively.

Once you have them defined, you can add them to the sub-sections as button 7 and 8 and give them a function.

On my ATV1, I don't have a /etc/lirc directory or a /.xbmc/userdata/Lircmap.xml file.
Umm.. I tried with latest Mac mini and minimal Maverick. Even the irw shows that both short and long presses are sending the same signal. Wouldn't that mean that the problem is with lircd.conf? I tried recording one myself but didn't help at all.
If you're using a full blown Mac, it's probably a little different. The Apple TV uses atvclient as the remote backend, so it's probably different from LIRC's implementation. Sorry, I couldn't be of more help.
@pumkinut
i'm running ubuntu karmic on a mac mini.

@Toiva
On my system there's also no difference between long and short press in irw. no difference with a self-recorded lircd.conf.

There must be one linux specialist out there who happens to know the answer! :-) I'm starting to believe it's impossible to get it to work.
For those arriving here and about to leave disappointed by Tijntje's conclusion: perhaps you'll find this fix from julian.neil useful: http://forum.xbmc.org/showthread.php?tid=115023
I've been playing with the latest RC of XBMCbuntu and all it took to get Apple remote working was to install atvclient. Even the multiremote profile in Harmony (called Plex Player) works nearly out of the box.

http://teknogeekz.com/blog/?p=422