NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: [SOLVED] Xbox 360 Wireless Controller Navigation

[SOLVED] Xbox 360 Wireless Controller Navigation 5 years 5 months ago #1

  • TechDrew
  • TechDrew's Avatar
I've seen a few other posts from people who were having problems with their 360 controller not working so I know I'm not the only one who still prefers it over a remote.
Well, with some hacking of SDLJoystick I have successfully added support to my build of OpenELEC for the Genuine Microsoft Xbox 360 Wireless Controller.

First, a brief overview of how this works.
The kernel has a driver (/drivers/input/joystick/xpad.c) which is responsible for the hardware. Everything in the 3.1 kernel that came with OpenELEC work with this controller except for the Ring of LEDs and rumble. Neither of those features matter much to me but I may look at fixing the LED issue with a kernel patch (here).
XBMC then uses the joystick via SDL. The SDL joystick code was/is a bit of a mess and I make no claim to have made it better - I just made it work. I doubt my hack will work with anything other than original xbox controllers, and with the hacks I did to the joystick polling to help with debugging it won't work if your joystick isn't id 0.

So what specifically was broken? The triggers.
The right and left triggers are setup with an axis of -32768 to 32767 and the code expects them to centre on 0. Unfortunately that's not the way it works as the triggers are spring loaded and are "at rest" at -32768.
With a few hacks I decreased the resolution of the movement detection to stay in 0 - 32767 but kept the percentage change resolution the full 64k.

To replicate this hack you'll need to follow the instructions here to get a build ready:
How To Build OpenELEC

Then you'll need to unpack the XBMC source files (/sources/xbmc/xbmc-[version].tar.xz):
tar -Jxfv sources/xbmc/xbmc-6922560.tar.xz
Then edit the c++ source files:
nano sources/xbmc/xbmc-6922560/xbmc/input/SDLJoystick.cpp
nano sources/xbmc/xbmc-6922560/xbmc/input/SDLJoystick.h
The changes I made are attached, and I'll paste them in a code block at the end of this post for reference.

Then, assuming that you've already built OpenELEC (I recommend you do to ensure that your build environment is working) you'll need to re-pack, destroy the cache, and rebuild.
Here's the shell script I wrote to do it:
#!/bin/sh
echo "Removing cached data..."
rm -rf build*/xbmc-6922560 build*/.stamps/xbmc

echo "Removing existing tar files..."
rm ./sources/xbmc/xbmc-6922560.tar.xz

echo "Creating new tar..."
cd sources/xbmc
tar -c --xz -f xbmc-6922560.tar.xz xbmc-6922560
cd ../..

echo "Regenerating md5 file..."
md5sum ./sources/xbmc/xbmc-6922560.tar.xz > ./sources/xbmc/xbmc-6922560.tar.xz.md5

echo "Removing old kernel and system images..."
rm -rf ./target/*

echo "Done!"
echo "To rebuild run: PROJECT=ION ARCH=x86_64 make"

Then, build the project, copy the KERNEL and SYSTEM files from target to the Update SMB share on your OpenELEC system and reboot. You should see it update and then restart. When it comes back your Xbox 360 controller should be working, but you'll need a working keymap.xml. You can put a custom one in either .xbmc/userdata/keymaps, or the Userdata/keymaps SMB share - they are one & the same.
I created a custom keymap and named it xbox360.xml, which I have also attached. The important part is this:
  <global>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Select</button> <!-- A -->
      <button id="2">Back</button> <!-- B -->
      <button id="3">Fullscreen</button> <!-- X -->
      <button id="4">OSD</button> <!-- Y -->
      <button id="5">ContextMenu</button> <!-- LB -->
      <button id="6"></button> <!-- RB -->
      <button id="7">Back</button> <!-- Back -->
      <button id="8"></button> <!-- Start -->
      <button id="9">XBMC.ActivateWindow(Home)</button>  <!-- Xbox 360 Button -->
      <button id="10"></button> <!-- Left Tumbstick Click -->
      <button id="11">Screenshot</button> <!-- Right Thumbstick Click -->
      <button id="12">Left</button> <!-- Dpad Left -->
      <button id="13">Right</button> <!-- Dpad Right -->
      <button id="14">Up</button> <!-- Dpad Up -->
      <button id="15">Down</button> <!-- Dpad Down -->
      
      <axis limit="-1" id="1"></axis> <!-- Left stick, left -->
	  <axis limit="1" id="1"></axis> <!-- Left stick, right -->
	  <axis limit="-1" id="2">ScrollUp</axis> <!-- Left stick, up -->
	  <axis limit="1" id="2">ScrollDown</axis> <!-- Left stick, down -->
	  
	  <axis limit="-1" id="4">AnalogSeekBack</axis> <!-- Right stick, left -->
	  <axis limit="1" id="4">AnalogSeekForward</axis> <!-- Right stick, right -->
	  <axis limit="-1" id="5">VolumeUp</axis> <!-- Right stick, up -->
      <axis limit="1" id="5">VolumeDown</axis> <!-- Right stick, down -->
      	  
	  <axis limit="1" id="3">ScrollUp</axis> <!-- Left Trigger -->
	  <axis limit="1" id="6">ScrollDown</axis> <!-- Right Trigger -->
  </joystick>
  </global>


That's what I did and now I've got a fully functional Xbox 360 wireless controller running my OpenELEC install! :D
The only thing I've noticed is that the analog fast forward and rewind functions need you to go slow to work 100%. If you just pull the trigger to go at 32x and then let go it'll probably keep it around 4-8x. If you slowly let go of the trigger it'll properly reset to "play". This is probably due to the loss of resolution on that axis; it just drops too fast for the polling to deal with properly.
Although, why does it poll anyways? Wouldn't event driven input be better?

-Andrew

P.S. Excuse the total hack job - I'm a DB developer, not a c++ dev... it works though and I'm happy. :P



Full SDLJoystick.cpp:
/*
*      Copyright (C) 2007-2010 Team XBMC
*      http://www.xbmc.org
*
*  This Program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2, or (at your option)
*  any later version.
*
*  This Program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with XBMC; see the file COPYING.  If not, write to
*  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*  http://www.gnu.org/copyleft/gpl.html
*
*/
//Modified Nov 18, 2011 by Andrew Lockwood
//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.

#include "system.h"
#include "SDLJoystick.h"
#include "ButtonTranslator.h"
#include "settings/AdvancedSettings.h"
#include "utils/log.h"

#include <math.h>

#ifdef HAS_SDL_JOYSTICK

using namespace std;

CJoystick g_Joystick; // global

CJoystick::CJoystick()
{
  Reset();
  m_NumAxes = 0;
  m_AxisId = 0;
  m_JoyId = 0;
  m_ButtonId = 0;
  m_HatId = 0;
  m_HatState = SDL_HAT_CENTERED;
  m_ActiveFlags = JACTIVE_NONE;
  is_used = false;
 for (int i = 0 ; i<MAX_AXES ; i++)
  {
   m_Amount[i] = 0;
  }
  SetDeadzone(0);
}

void CJoystick::Initialize()
{
  // clear old joystick names
  m_JoystickNames.clear();

  // any open ones? if so, close them.
  if (m_Joysticks.size()>0)
  {
    for(size_t idJoy = 0; idJoy < m_Joysticks.size(); idJoy++)
    {
      // any joysticks unplugged?
      if(SDL_JoystickOpened(idJoy))
        SDL_JoystickClose(m_Joysticks[idJoy]);
    }
    m_Joysticks.clear();
    m_JoyId = -1;
  }

  // Set deadzone range
  SetDeadzone(g_advancedSettings.m_controllerDeadzone);

  // any joysticks connected?
  if (SDL_NumJoysticks()>0)
  {
    // load joystick names and open all connected joysticks
    for (int i = 0 ; i<SDL_NumJoysticks() ; i++)
    {
      if (i > 0) //Hack to stop extra joysticks from being polled. Controller is always joy 0 on my system but 4 show up...?
       break;

      SDL_Joystick *joy = SDL_JoystickOpen(i);

      m_Joysticks.push_back(joy);
      if (joy)
      {
        m_JoystickNames.push_back(string(SDL_JoystickName(i)));
        CLog::Log(LOGNOTICE, "Enabled Joystick: %s, Joystick Id: %d", SDL_JoystickName(i), i);
        CLog::Log(LOGNOTICE, "Details: Total Axis: %d Total Hats: %d Total Buttons: %d",
            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));
        CLog::Log(LOGNOTICE, "**SUPPORT FOR XBOX 360 CONTROLLER ONLY**");
      }
      else
      {
        m_JoystickNames.push_back(string(""));
      }
    }
  }
  
  // disable joystick events, since we'll be polling them
  SDL_JoystickEventState(SDL_DISABLE);
}

void CJoystick::Reset(bool axis)
{
  if (axis)
  {
    SetAxisActive(false);
    for (int i = 0 ; i<MAX_AXES ; i++)
    {
      ResetAxis(i);
    }
  }
}

void CJoystick::Update()
{
  int buttonId    = -1;
  int axisId      = -1;
  //int hatId       = -1;
  int numj        = m_Joysticks.size();
  if (numj <= 0)
    return;

  numj = 1; //hack to disable needless polling as my system always has the joystick on joystick 0
  CLog::Log(LOGDEBUG, "Entered CJoystick::Update()...");

  // update the state of all opened joysticks
  SDL_JoystickUpdate();

  // go through all joysticks
  for (int j = 0; j<numj; j++)
  {
    CLog::Log(LOGDEBUG, "JoyStick Id = %d", j);
    
    SDL_Joystick *joy = m_Joysticks[j];
    int numb = SDL_JoystickNumButtons(joy);
    int numax = SDL_JoystickNumAxes(joy);
    numax = (numax>MAX_AXES)?MAX_AXES:numax;
    int axisval;

    // get button states first, they take priority over axis
    for (int b = 0 ; b<numb ; b++)
    {
      if (SDL_JoystickGetButton(joy, b))
      {
        m_JoyId = SDL_JoystickIndex(joy);
        buttonId = b+1;
        j = numj-1;
        break;
      }
    }
    
    //removed hat check

    // get axis states
    m_NumAxes = numax;
    for (int a = 0 ; a<numax ; a++)
    {
      axisval = SDL_JoystickGetAxis(joy, a);
      axisId = a+1;
      if (axisId<=0 || axisId>=MAX_AXES)
      {
        CLog::Log(LOGERROR, "Axis Id out of range. Maximum supported axis: %d", MAX_AXES);
      }
      else
      {
        m_Amount[axisId] = axisval;  //-32768 to 32767
	
        if (is_used == false && axisval != 0 && (axisId == 3 || axisId == 6))
	  is_used = true; //set to true as an axis or button has been touched and it's no longer the default 0 init value
	CLog::Log(LOGDEBUG, "Axis %d value = %d", axisId, axisval);
      }
    }

    m_AxisId = GetAxisWithMaxAmount();

    if (m_AxisId) //if !0 set the joystick index and break out of the loop
    {
      m_JoyId = SDL_JoystickIndex(joy);
      j = numj-1;
      break;
    }
  }

  //removed hat code

  if (buttonId==-1)
  {
    if (m_ButtonId!=0)
    {
      CLog::Log(LOGDEBUG, "Joystick %d button %d Up", m_JoyId, m_ButtonId);
    }
    m_pressTicksButton = 0;
    SetButtonActive(false);
    m_ButtonId = 0;
  }
  else
  {
    if (buttonId!=m_ButtonId)
    {
      CLog::Log(LOGDEBUG, "Joystick %d button %d Down", m_JoyId, buttonId);
      m_ButtonId = buttonId;
      m_pressTicksButton = SDL_GetTicks();
    }
    SetButtonActive();
  }
}

void CJoystick::Update(SDL_Event& joyEvent)
{
  //Stubbed out - never saw this called. Assuming it's used for event based detection. Why is that not the default?
  //Seems that event based triggering would be more efficient than polling...?
}

bool CJoystick::GetHat(int &id, int &position,bool consider_repeat) 
{
  //stubbed out
  return false;
} 

bool CJoystick::GetButton(int &id, bool consider_repeat)
{
  if (!IsButtonActive())
    return false;
  if (!consider_repeat)
  {
    id = m_ButtonId;
    return true;
  }

  static uint32_t lastPressTicks = 0;
  static uint32_t lastTicks = 0;
  static uint32_t nowTicks = 0;

  if ((m_ButtonId>=0) && m_pressTicksButton)
  {
    // return the id if it's the first press
    if (lastPressTicks!=m_pressTicksButton)
    {
      lastPressTicks = m_pressTicksButton;
      id = m_ButtonId;
      return true;
    }
    nowTicks = SDL_GetTicks();
    if ((nowTicks-m_pressTicksButton)<500) // 500ms delay before we repeat
    {
      return false;
    }
    if ((nowTicks-lastTicks)<100) // 100ms delay before successive repeats
    {
      return false;
    }
    lastTicks = nowTicks;
  }
  id = m_ButtonId;
  return true;
}

int CJoystick::GetAxisWithMaxAmount()
{
  static int maxAmount;
  static int axis;
  axis = 0;
  maxAmount = 0;
  int tempf;
  int tempval;

  for (int i = 1 ; i<=m_NumAxes ; i++)
  {
    tempf = abs(m_Amount[i]);
    tempval = TriggerValue(m_Amount[i]);

    //CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount - tempf = %d, non-abs value = %d,Axis = %d", tempf, tempval, i);

    if ((i == 3 || i == 6) && tempval > 0) //TriggerValue accounts for init =0 case and then scales properly 
    {
      maxAmount = (tempval / 2); //divide by 2 as it won't handle > 32768
      axis = i;
      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_2 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], (maxAmount / 2));
    }

    if (tempf>m_DeadzoneRange && tempf>maxAmount && i != 3 && i != 6)
    {
      maxAmount = tempf;
      axis = i;
      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_3 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], maxAmount);
    }
  }
  
  CLog::Log(LOGDEBUG, "SetAxisActive? - %d", (0 != maxAmount));
  SetAxisActive(0 != maxAmount);
  return axis;
}

float CJoystick::GetAmount(int axis)
{
  CLog::Log(LOGDEBUG, "GetAmount - Axis %d, m_Amount = %d, MAX_AXIS = %d, m_Deadzone = %d", axis, m_Amount[axis], MAX_AXISAMOUNT, m_DeadzoneRange);
  float fval = 0;

  if ((axis == 3 || axis == 6) && TriggerValue(m_Amount[axis]) != 0) //ignore 0
    fval = (float)(TriggerValue(m_Amount[axis]))/(float)(65535); //trigger is re-scaled to all positive
  else if ((m_Amount[axis] > m_DeadzoneRange) && axis != 3 && axis != 6)
    fval = (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
  else if ((m_Amount[axis] < -m_DeadzoneRange) && axis != 3 && axis != 6)
    fval = (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);

  CLog::Log(LOGDEBUG, "GetAmount_2 - Axis %d, fval =  %f", axis, fval);
  return fval;
}

int CJoystick::TriggerValue(int axisValue)
{
  if (is_used == true && axisValue  > -32268) //minimal deadzone (500) due to springs on the triggers
    return (axisValue + 32768); //scale becomes 0 to 65535 because max positive = 32767
  else
    return 0;
}

float CJoystick::SetDeadzone(float val)
{
  if (val<0) val=0;
  if (val>1) val=1;
  m_DeadzoneRange = (int)(val*MAX_AXISAMOUNT);
 
  CLog::Log(LOGDEBUG, "SetDeadzone value =  %f", val);
  return val;
}

#endif

Full SDLJoystick.h:
/*
*      Copyright (C) 2007-2010 Team XBMC
*      http://www.xbmc.org
*
*  This Program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2, or (at your option)
*  any later version.
*
*  This Program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with XBMC; see the file COPYING.  If not, write to
*  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*  http://www.gnu.org/copyleft/gpl.html
*
*/
//Modified Nov 18, 2011 by Andrew Lockwood
//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
#ifndef SDL_JOYSTICK_H
#define SDL_JOYSTICK_H

#include "system.h" // for HAS_SDL_JOYSTICK
#include <vector>
#include <string>

#define JACTIVE_BUTTON 0x00000001
#define JACTIVE_AXIS   0x00000002
#define JACTIVE_HAT    0x00000004
#define JACTIVE_NONE   0x00000000
#define JACTIVE_HAT_UP    0x01
#define JACTIVE_HAT_RIGHT 0x02
#define JACTIVE_HAT_DOWN  0x04
#define JACTIVE_HAT_LEFT  0x08

#ifdef HAS_SDL_JOYSTICK

#include <SDL/SDL_joystick.h>
#include <SDL/SDL_events.h>

#define MAX_AXES 64
#define MAX_AXISAMOUNT 32768

// Class to manage all connected joysticks

class CJoystick
{
public:
  CJoystick();

  void Initialize();
  void Reset(bool axis=false);
  void ResetAxis(int axisId) { m_Amount[axisId] = 0; }
  void Update();
  void Update(SDL_Event& event);
  bool GetButton (int& id, bool consider_repeat=true);
  bool GetAxis (int &id) { if (!IsAxisActive()) return false; id=m_AxisId; return true; }
  bool GetHat (int &id, int &position, bool consider_repeat=true);
  std::string GetJoystick() { return (m_JoyId>-1)?m_JoystickNames[m_JoyId]:""; }
  int GetAxisWithMaxAmount();
  float GetAmount(int axis);
  float GetAmount() { return GetAmount(m_AxisId); }
  float SetDeadzone(float val);

private:
  void SetAxisActive(bool active=true) { m_ActiveFlags = active?(m_ActiveFlags|JACTIVE_AXIS):(m_ActiveFlags&(~JACTIVE_AXIS)); }
  void SetButtonActive(bool active=true) { m_ActiveFlags = active?(m_ActiveFlags|JACTIVE_BUTTON):(m_ActiveFlags&(~JACTIVE_BUTTON)); }
  void SetHatActive(bool active=true) { m_ActiveFlags = active?(m_ActiveFlags|JACTIVE_HAT):(m_ActiveFlags&(~JACTIVE_HAT)); }
  bool IsButtonActive() { return (m_ActiveFlags & JACTIVE_BUTTON) == JACTIVE_BUTTON; }
  bool IsAxisActive() { return (m_ActiveFlags & JACTIVE_AXIS) == JACTIVE_AXIS; }
  bool IsHatActive() { return (m_ActiveFlags & JACTIVE_HAT) == JACTIVE_HAT; }
  int TriggerValue(int axisValue);

  int m_Amount[MAX_AXES];
  int m_AxisId;
  int m_ButtonId;
  uint8_t m_HatState;
  int m_HatId; 
  int m_JoyId;
  int m_NumAxes;
  int m_DeadzoneRange;
  uint32_t m_pressTicksButton;
  uint32_t m_pressTicksHat;
  uint8_t m_ActiveFlags;
  std::vector<SDL_Joystick*> m_Joysticks;
  std::vector<std::string> m_JoystickNames;
  bool is_used;
};

extern CJoystick g_Joystick;

#endif

#endif
Last Edit: 5 years 5 months ago by TechDrew. Reason: Formatting
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 5 months ago #2

  • TechDrew
  • TechDrew's Avatar
The attachments don't seem to be showing up. Here is the full text of my custom xbox360.xml keymap file.

xbox360.xml:
<!-- This file is designed to work only with the Xbox 360 Wireless Controller -->
<!-- It will only work correctly with a modified SDLJoystick.cpp file that    -->
<!-- has fixes in it for the 360 triggers                                     -->

<keymap>
  <global>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Select</button> <!-- A -->
      <button id="2">Back</button> <!-- B -->
      <button id="3">Fullscreen</button> <!-- X -->
      <button id="4">OSD</button> <!-- Y -->
      <button id="5">ContextMenu</button> <!-- LB -->
      <button id="6"></button> <!-- RB -->
      <button id="7">Back</button> <!-- Back -->
      <button id="8"></button> <!-- Start -->
      <button id="9">XBMC.ActivateWindow(Home)</button>  <!-- Xbox 360 Button -->
      <button id="10"></button> <!-- Left Tumbstick Click -->
      <button id="11">Screenshot</button> <!-- Right Thumbstick Click -->
      <button id="12">Left</button> <!-- Dpad Left -->
      <button id="13">Right</button> <!-- Dpad Right -->
      <button id="14">Up</button> <!-- Dpad Up -->
      <button id="15">Down</button> <!-- Dpad Down -->
      
      <axis limit="-1" id="1"></axis> <!-- Left stick, left -->
	  <axis limit="1" id="1"></axis> <!-- Left stick, right -->
	  <axis limit="-1" id="2">ScrollUp</axis> <!-- Left stick, up -->
	  <axis limit="1" id="2">ScrollDown</axis> <!-- Left stick, down -->
	  
	  <axis limit="-1" id="4">AnalogSeekBack</axis> <!-- Right stick, left -->
	  <axis limit="1" id="4">AnalogSeekForward</axis> <!-- Right stick, right -->
	  <axis limit="-1" id="5">VolumeUp</axis> <!-- Right stick, up -->
      <axis limit="1" id="5">VolumeDown</axis> <!-- Right stick, down -->
      	  
	  <axis limit="1" id="3">ScrollUp</axis> <!-- Left Trigger -->
	  <axis limit="1" id="6">ScrollDown</axis> <!-- Right Trigger -->
  </joystick>
  </global>
  <Home>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="3">XBMC.Skin.ToggleSetting(HomeViewToggle)</button> -->
    </joystick>
  </Home>
  <MyFiles>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="5">Highlight</button>
    </joystick>
  </MyFiles>
  <MyMusicPlaylist>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="3">Back</button>
      <!-- <button id="5">Delete</button> -->
    </joystick>
  </MyMusicPlaylist>
  <MyMusicFiles>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="3">FullScreen</button>
      <button id="5">ContextMenu</button>
    </joystick>
  </MyMusicFiles>
  <MyMusicLibrary>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="3">Playlist</button> -->
      <button id="5">ContextMenu</button>
    </joystick>
  </MyMusicLibrary>
  <FullscreenVideo>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Pause</button>
      <button id="2">Stop</button>
      <button id="3">CodecInfo</button>
      <button id="5">AspectRatio</button>
      <button id="6">Info</button>
      <button id="9">OSD</button>
      <button id="14">BigStepForward</button>
      <button id="13">StepForward</button>
      <button id="15">BigStepBack</button>
      <button id="12">StepBack</button>      
      <axis limit="1" id="3">AnalogRewind</axis>
      <axis limit="1" id="6">AnalogFastForward</axis>
    </joystick>
  </FullscreenVideo>
  <FullscreenInfo>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
    </joystick>
  </FullscreenInfo>
  <PlayerControls>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
    </joystick>
  </PlayerControls>
  <Visualisation>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Pause</button>
      <button id="2">Stop</button>
      <button id="3">FullScreen</button>
	  <button id="4">CodecInfo</button>
      <button id="5">XBMC.ActivateWindow(VisualisationPresetList)</button>
      <button id="6">Info</button>
      <button id="4">XBMC.ActivateWindow(MusicOSD)</button>
      <button id="12">SkipPrevious</button>
	  <button id="13">SkipNext</button>
	  <button id="14">PreviousPreset</button>
	  <button id="15">NextPreset</button>
      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
    </joystick>
  </Visualisation>
  <MusicOSD>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
      <!-- <button id="3">CodecInfo</button> -->
      <!-- <button id="6">Info</button> -->
    </joystick>
  </MusicOSD>
  <VisualisationSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
      <!-- <button id="9">Back</button> -->
    </joystick>
  </VisualisationSettings>
  <VisualisationPresetList>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
      <!-- <button id="3">Back</button> -->
      <!-- <button id="9">Back</button> -->
    </joystick>
  </VisualisationPresetList>
  <SlideShow>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="1">Pause</button> -->
      <!-- <button id="2">Stop</button> -->
      <!-- <button id="10">CodecInfo</button> -->
      <!-- <button id="9">ZoomNormal</button> -->
      <!-- <button id="14">Rotate</button> -->
      <!-- <button id="4">Info</button> -->
      <!-- <button id="5">ZoomIn</button> -->
      <!-- <button id="13">NextPicture</button> -->
      <!-- <button id="6">ZoomOut</button> -->
      <!-- <button id="12">PreviousPicture</button> -->
    </joystick>
  </SlideShow>
  <ScreenCalibration>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">NextCalibration</button>
      <button id="3">ResetCalibration</button>
      <button id="4">NextResolution</button>
    </joystick>
  </ScreenCalibration>
  <GUICalibration>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">NextCalibration</button>
      <button id="3">ResetCalibration</button>
      <button id="4">NextResolution</button>
    </joystick>
  </GUICalibration>
  <VideoOSD>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
    </joystick>
  </VideoOSD>
  <VideoMenu>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="5">AspectRatio</button> -->
      <!-- <button id="2">Stop</button> -->
      <!-- <button id="9">OSD</button> -->
      <!-- <button id="4">Info</button> -->
      <!-- <button id="3">CodecInfo</button> -->
    </joystick>
  </VideoMenu>
  <OSDVideoSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="4"/> -->
      <!-- <button id="5">AspectRatio</button> -->
      <!-- <button id="19">Back</button> -->
    </joystick>
  </OSDVideoSettings>
  <OSDAudioSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="4"/> -->
      <!-- <button id="5">AspectRatio</button> -->
      <!-- <button id="7">Back</button> -->
    </joystick>
  </OSDAudioSettings>
  <VideoBookmarks>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="4"/> -->
      <!-- <button id="5">Delete</button> -->
      <!-- <button id="7">Back</button> -->
    </joystick>
  </VideoBookmarks>
  <MyVideoLibrary>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="3">Delete</button> -->
    </joystick>
  </MyVideoLibrary>
  <MyVideoFiles>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="5">Queue</button> -->
      <!-- <button id="3">Playlist</button> -->
    </joystick>
  </MyVideoFiles>
  <MyVideoPlaylist>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="5">Delete</button> -->
      <!-- <button id="7">Back</button> -->
    </joystick>
  </MyVideoPlaylist>
  <VirtualKeyboard>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="8">Enter</button>
      <button id="3">BackSpace</button>
      <button id="5">Shift</button>
      <button id="6">Symbols</button>
    </joystick>
  </VirtualKeyboard>
  <ContextMenu>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="7">Back</button> -->
    </joystick>
  </ContextMenu>
  <Scripts>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="4">XBMC.ActivateWindow(ScriptsDebugInfo)</button>
    </joystick>
  </Scripts>
  <NumericInput>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="3">BackSpace</button>
      <button id="8">Enter</button>
    </joystick>
  </NumericInput>
  <GamepadInput>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="9">Stop</button> -->
    </joystick>
  </GamepadInput>
  <LockSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="7">Back</button> -->
    </joystick>
  </LockSettings>
  <ProfileSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="7">Back</button> -->
    </joystick>
  </ProfileSettings>
</keymap>
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 5 months ago #3

  • bnevets27
  • bnevets27's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
  • Karma: 0
Has this been added to openelec? If not is it planned to be added?
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 4 months ago #4

  • TassLehoff
  • TassLehoff's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
This really a great news.I'm waiting to test that on a daily build.

Thanks for your work TechDrew. :)
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 4 months ago #5

  • haywire
  • haywire's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
This is great! thanks for sharing TechDrew

any chance you could please post the installation files so that i dont have to build my own copy?



Mods, in the future is this possible to get this added to the build?
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 4 months ago #6

  • TassLehoff
  • TassLehoff's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
I'm not sure if this is merged in the last build, but i try the Keymap.xml with the last official ion 64 daily build and that's work. The only thing who appears to not working good is the analog, both trigger and stick.

I change the keymap.xml for my own use and that also work.
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 3 months ago #7

  • thomas
  • thomas's Avatar
is the install file available to accomplish this? or is there a plan to incorporate this into a build?


great job btw
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 3 months ago #8

  • bladesuk1
  • bladesuk1's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Karma: 0
there might be a better way to achieve this rather than changing the xbmc code.

when i used to run my xbmc on arch, i used to use xboxdrv instead to retrieve the input from the xbox gamepad. here's the post i used to get this working:
www.aranea.be/blog/?p=42

if you use the xboxdrv driver instead, then the offsets are dealt with properly, so you don't need to change the xbmc code (which would mean it would fail to work for other controllers).
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 3 months ago #9

  • dahool
  • dahool's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 1
  • Karma: 0
Hi,

Anyone tried this hack with a wired controller? Does it work?
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 2 months ago #10

  • dahool
  • dahool's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 1
  • Karma: 0
Hi again,

I changed the xbox360.xml, posted above to work with xbox360 wired controller as well.
You can use my attached file or change the .xml like described below.

First thing you have to change is the name from <joystick name="Xbox 360 Wireless Receiver"> to <joystick name=""Microsoft X-Box 360 pad""> for every occurence in the file.

This enables the recognition of the wired controller.

Second you have to enable D-pad for moving trough menus.

Comment the d-pad inputs. Like shown below:

<!-- button id="12">Left</button --> <!-- Dpad Left -->
<!-- button id="13">Right</button --> <!-- Dpad Right -->
<!-- button id="14">Up</button --> <!-- Dpad Up -->
<!-- button id="15">Down</button --> <!-- Dpad Down -->

Write new inputs under the commented ones. Like shown below:

<hat id="1" position="up">Up</hat>
<hat id="1" position="right">Right</hat>
<hat id="1" position="down">Down</hat>
<hat id="1" position="left">Left</hat>

Now you should be able to move around with your D-pad on your wired controller.


Now time to make PS2 emulator working on openelec, to fully use the new controller:)

enjoy
B)
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 2 months ago #11

  • de45dd
  • de45dd's Avatar
  • Offline
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
Hi,

I now have created two (one for pvr and one for normal xbmc) patches which will make the changes from TechDrew for us. So we don´t need to edit files manually and repack them.

The following files will get patched:

/xbmc/input/SDLJoystick.cpp
/xbmc/input/SDLJoystick.h
/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml

Is you can see I will patch the existing Xbox360.xml instead of making a CustomOne.

After Checkout just copy the patches to:

./packages/mediacenter/xbmc/patches
or
./packages/mediacenter/xbmc-pvr/patches

before building.
Last Edit: 5 years 2 months ago by de45dd.
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 5 years 2 months ago #12

  • de45dd
  • de45dd's Avatar
  • Offline
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
I think I am to silly to add a a attachment...

So I will do it as code:

xbmc-1fef727-982-Enable_xbox360_controller.patch:
diff -Naur xbmc-1fef727/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml xbmc-1fef727.patch/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml
--- xbmc-1fef727/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml	2012-02-07 12:47:08.000000000 +0100
+++ xbmc-1fef727.patch/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml	2012-02-07 16:25:10.091108000 +0100
@@ -1,70 +1,43 @@
-<!-- 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.                                                                                     -->
+<!-- This file is designed to work only with the Xbox 360 Wireless Controller -->
+<!-- It will only work correctly with a modified SDLJoystick.cpp file that    -->
+<!-- has fixes in it for the 360 triggers                                     -->
 
-<!-- The format is:                      -->
-<!--    <device>                         -->
-<!--      <button>action</button>        -->
-<!--    </device>                        -->
-
-<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
-<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
-<!-- You set it up by adding a <universalremote> block to the window or <global> section:       -->
-<!--    <universalremote>             -->
-<!--       <obc45>Stop</obc45>         -->
-<!--    </universalremote>            -->
-
-<!-- Note that the action can be a built-in function.                 -->
-<!--  eg <B>XBMC.ActivateWindow(MyMusic)</B>                         -->
-<!-- would automatically go to My Music on the press of the B button. -->
-
-<!-- Joysticks / Gamepads:                                                                    -->
-<!--   See the sample PS3 controller configuration below for the format.                      -->
-<!--                                                                                          -->
-<!--  Joystick Name:                                                                          -->
-<!--   Do 'cat /proc/bus/input/devices' or see your xbmc log file  to find the names of       -->
-<!--   detected joysticks. The name used in the configuration should match the detected name. -->
-<!--                                                                                          -->
-<!--  Button Ids:                                                                             -->
-<!--   'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear   -->
-<!--   in xbmc.log when they are pressed. Use your log to map custom buttons to actions.      -->
-<!--                                                                                          -->
-<!--  Axis Ids / Analog Controls                                                              -->
-<!--   Coming soon.                                                                           -->
 <keymap>
   <global>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">Select</button> <!-- A -->
       <button id="2">Back</button> <!-- B -->
-      <button id="3"></button> <!-- X -->
-      <button id="4"></button> <!-- Y -->
-      <button id="5"></button> <!-- LB -->
+      <button id="3">Fullscreen</button> <!-- X -->
+      <button id="4">OSD</button> <!-- Y -->
+      <button id="5">ContextMenu</button> <!-- LB -->
       <button id="6"></button> <!-- RB -->
-      <button id="7"></button> <!-- ? -->
-      <button id="8"></button> <!-- ? -->
-      <button id="9">XBMC.ActivateWindow(PlayerControls)</button>
-      <button id="10"/>
-      <button id="11">Up</button>
-      <button id="12">Down</button>
-      <button id="13">Left</button>
-      <button id="14">Right</button>
-      <button id="15"></button>
-      <button id="16"></button>
-      <button id="17">PreviousMenu</button>
-      <axis limit="-1" id="5">VolumeUp</axis>
-      <axis limit="+1" id="5">VolumeDown</axis>
-      <axis limit="-1" id="4">AnalogSeekBack</axis>
-      <axis limit="+1" id="4">AnalogSeekForward</axis>
-      <axis limit="0" id="3">ScrollUp</axis>
-      <axis limit="0" id="6">ScrollDown</axis>
-    </joystick>
+      <button id="7">Back</button> <!-- Back -->
+      <button id="8"></button> <!-- Start -->
+      <button id="9">XBMC.ActivateWindow(Home)</button>  <!-- Xbox 360 Button -->
+      <button id="10"></button> <!-- Left Tumbstick Click -->
+      <button id="11">Screenshot</button> <!-- Right Thumbstick Click -->
+      <button id="12">Left</button> <!-- Dpad Left -->
+      <button id="13">Right</button> <!-- Dpad Right -->
+      <button id="14">Up</button> <!-- Dpad Up -->
+      <button id="15">Down</button> <!-- Dpad Down -->
+      
+      <axis limit="-1" id="1"></axis> <!-- Left stick, left -->
+	  <axis limit="1" id="1"></axis> <!-- Left stick, right -->
+	  <axis limit="-1" id="2">ScrollUp</axis> <!-- Left stick, up -->
+	  <axis limit="1" id="2">ScrollDown</axis> <!-- Left stick, down -->
+	  
+	  <axis limit="-1" id="4">AnalogSeekBack</axis> <!-- Right stick, left -->
+	  <axis limit="1" id="4">AnalogSeekForward</axis> <!-- Right stick, right -->
+	  <axis limit="-1" id="5">VolumeUp</axis> <!-- Right stick, up -->
+      <axis limit="1" id="5">VolumeDown</axis> <!-- Right stick, down -->
+      	  
+	  <axis limit="1" id="3">ScrollUp</axis> <!-- Left Trigger -->
+	  <axis limit="1" id="6">ScrollDown</axis> <!-- Right Trigger -->
+  </joystick>
   </global>
   <Home>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">XBMC.Skin.ToggleSetting(HomeViewToggle)</button>
+      <!-- <button id="3">XBMC.Skin.ToggleSetting(HomeViewToggle)</button> -->
     </joystick>
   </Home>
   <MyFiles>
@@ -75,19 +48,19 @@
   <MyMusicPlaylist>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="3">Back</button>
-      <button id="5">Delete</button>
+      <!-- <button id="5">Delete</button> -->
     </joystick>
   </MyMusicPlaylist>
   <MyMusicFiles>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Playlist</button>
-      <button id="5">Queue</button>
+      <button id="3">FullScreen</button>
+      <button id="5">ContextMenu</button>
     </joystick>
   </MyMusicFiles>
   <MyMusicLibrary>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Playlist</button>
-      <button id="5">Queue</button>
+      <!-- <button id="3">Playlist</button> -->
+      <button id="5">ContextMenu</button>
     </joystick>
   </MyMusicLibrary>
   <FullscreenVideo>
@@ -98,183 +71,179 @@
       <button id="5">AspectRatio</button>
       <button id="6">Info</button>
       <button id="9">OSD</button>
-      <button id="13">BigStepForward</button>
-      <button id="14">StepForward</button>
+      <button id="14">BigStepForward</button>
+      <button id="13">StepForward</button>
       <button id="15">BigStepBack</button>
-      <button id="16">StepBack</button>
-      <button id="17">SmallStepBack</button>
-      <axis limit="0" id="3">AnalogRewind</axis>
-      <axis limit="0" id="6">AnalogFastForward</axis>
+      <button id="12">StepBack</button>      
+      <axis limit="1" id="3">AnalogRewind</axis>
+      <axis limit="1" id="6">AnalogFastForward</axis>
     </joystick>
   </FullscreenVideo>
   <FullscreenInfo>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">CodecInfo</button>
-      <button id="6">Back</button>
-      <button id="9">OSD</button>
-      <axis limit="0" id="3">AnalogRewind</axis>
-      <axis limit="0" id="6">AnalogFastForward</axis>
+      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
+      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
     </joystick>
   </FullscreenInfo>
   <PlayerControls>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
     </joystick>
   </PlayerControls>
   <Visualisation>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">Pause</button>
       <button id="2">Stop</button>
-      <button id="3">CodecInfo</button>
+      <button id="3">FullScreen</button>
+	  <button id="4">CodecInfo</button>
       <button id="5">XBMC.ActivateWindow(VisualisationPresetList)</button>
       <button id="6">Info</button>
-      <button id="9">XBMC.ActivateWindow(MusicOSD)</button>
-      <button id="13">NextPreset</button>
-      <button id="14">SkipNext</button>
-      <button id="15">PreviousPreset</button>
-      <button id="16">SkipPrevious</button>
-      <axis limit="0" id="3">AnalogRewind</axis>
-      <axis limit="0" id="6">AnalogFastForward</axis>
+      <button id="4">XBMC.ActivateWindow(MusicOSD)</button>
+      <button id="12">SkipPrevious</button>
+	  <button id="13">SkipNext</button>
+	  <button id="14">PreviousPreset</button>
+	  <button id="15">NextPreset</button>
+      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
+      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
     </joystick>
   </Visualisation>
   <MusicOSD>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="19">Back</button>
-      <button id="3">CodecInfo</button>
-      <button id="6">Info</button>
+      <!-- <button id="2">Back</button> -->
+      <!-- <button id="3">CodecInfo</button> -->
+      <!-- <button id="6">Info</button> -->
     </joystick>
   </MusicOSD>
   <VisualisationSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Back</button>
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
+      <!-- <button id="9">Back</button> -->
     </joystick>
   </VisualisationSettings>
   <VisualisationPresetList>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Back</button>
-      <button id="5">Back</button>
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
+      <!-- <button id="3">Back</button> -->
+      <!-- <button id="9">Back</button> -->
     </joystick>
   </VisualisationPresetList>
   <SlideShow>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="1">Pause</button>
-      <button id="2">Stop</button>
-      <button id="3">CodecInfo</button>
-      <button id="4">ZoomNormal</button>
-      <button id="5">Rotate</button>
-      <button id="6">Info</button>
-      <button id="13">ZoomIn</button>
-      <button id="14">NextPicture</button>
-      <button id="15">ZoomOut</button>
-      <button id="16">PreviousPicture</button>
-      <button id="17">Stop</button>
+      <!-- <button id="1">Pause</button> -->
+      <!-- <button id="2">Stop</button> -->
+      <!-- <button id="10">CodecInfo</button> -->
+      <!-- <button id="9">ZoomNormal</button> -->
+      <!-- <button id="14">Rotate</button> -->
+      <!-- <button id="4">Info</button> -->
+      <!-- <button id="5">ZoomIn</button> -->
+      <!-- <button id="13">NextPicture</button> -->
+      <!-- <button id="6">ZoomOut</button> -->
+      <!-- <button id="12">PreviousPicture</button> -->
     </joystick>
   </SlideShow>
   <ScreenCalibration>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">NextCalibration</button>
       <button id="3">ResetCalibration</button>
-      <button id="6">NextResolution</button>
+      <button id="4">NextResolution</button>
     </joystick>
   </ScreenCalibration>
   <GUICalibration>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">NextCalibration</button>
       <button id="3">ResetCalibration</button>
-      <button id="6">NextResolution</button>
+      <button id="4">NextResolution</button>
     </joystick>
   </GUICalibration>
   <VideoOSD>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
     </joystick>
   </VideoOSD>
   <VideoMenu>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="5">AspectRatio</button>
-      <button id="2">Stop</button>
-      <button id="9">OSD</button>
-      <button id="6">Info</button>
-      <button id="3">CodecInfo</button>
+      <!-- <button id="5">AspectRatio</button> -->
+      <!-- <button id="2">Stop</button> -->
+      <!-- <button id="9">OSD</button> -->
+      <!-- <button id="4">Info</button> -->
+      <!-- <button id="3">CodecInfo</button> -->
     </joystick>
   </VideoMenu>
   <OSDVideoSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="4"/>
-      <button id="5">AspectRatio</button>
-      <button id="19">Back</button>
+      <!-- <button id="4"/> -->
+      <!-- <button id="5">AspectRatio</button> -->
+      <!-- <button id="19">Back</button> -->
     </joystick>
   </OSDVideoSettings>
   <OSDAudioSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="4"/>
-      <button id="5">AspectRatio</button>
-      <button id="19">Back</button>
+      <!-- <button id="4"/> -->
+      <!-- <button id="5">AspectRatio</button> -->
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </OSDAudioSettings>
   <VideoBookmarks>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="4"/>
-      <button id="5">Delete</button>
-      <button id="19">Back</button>
+      <!-- <button id="4"/> -->
+      <!-- <button id="5">Delete</button> -->
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </VideoBookmarks>
   <MyVideoLibrary>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Delete</button>
+      <!-- <button id="3">Delete</button> -->
     </joystick>
   </MyVideoLibrary>
   <MyVideoFiles>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="5">Queue</button>
-      <button id="3">Playlist</button>
+      <!-- <button id="5">Queue</button> -->
+      <!-- <button id="3">Playlist</button> -->
     </joystick>
   </MyVideoFiles>
   <MyVideoPlaylist>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="5">Delete</button>
-      <button id="3">Back</button>
+      <!-- <button id="5">Delete</button> -->
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </MyVideoPlaylist>
   <VirtualKeyboard>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Enter</button>
-      <button id="2">BackSpace</button>
+      <button id="8">Enter</button>
+      <button id="3">BackSpace</button>
       <button id="5">Shift</button>
-      <button id="4">Symbols</button>
+      <button id="6">Symbols</button>
     </joystick>
   </VirtualKeyboard>
   <ContextMenu>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="6">Back</button>
+      <button id="7">Back</button> -->
     </joystick>
   </ContextMenu>
   <Scripts>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">XBMC.ActivateWindow(ScriptsDebugInfo)</button>
+      <button id="4">XBMC.ActivateWindow(ScriptsDebugInfo)</button>
     </joystick>
   </Scripts>
   <NumericInput>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="2">BackSpace</button>
-      <button id="9">Enter</button>
+      <button id="3">BackSpace</button>
+      <button id="8">Enter</button>
     </joystick>
   </NumericInput>
   <GamepadInput>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Stop</button>      <!-- Enter Password -->
+      <!-- <button id="9">Stop</button> -->
     </joystick>
   </GamepadInput>
   <LockSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </LockSettings>
   <ProfileSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </ProfileSettings>
-</keymap>
+</keymap>
\ Kein Zeilenumbruch am Dateiende.
diff -Naur xbmc-1fef727/xbmc/input/SDLJoystick.cpp xbmc-1fef727.patch/xbmc/input/SDLJoystick.cpp
--- xbmc-1fef727/xbmc/input/SDLJoystick.cpp	2012-02-07 12:46:48.000000000 +0100
+++ xbmc-1fef727.patch/xbmc/input/SDLJoystick.cpp	2012-02-07 16:26:02.181313000 +0100
@@ -18,6 +18,8 @@
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
+//Modified Nov 18, 2011 by Andrew Lockwood
+//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
 
 #include "system.h"
 #include "SDLJoystick.h"
@@ -43,8 +45,11 @@
   m_HatId = 0;
   m_HatState = SDL_HAT_CENTERED;
   m_ActiveFlags = JACTIVE_NONE;
-  for (int i = 0 ; i<MAX_AXES ; i++)
-    m_Amount[i] = 0;
+  is_used = false;
+ for (int i = 0 ; i<MAX_AXES ; i++)
+  {
+   m_Amount[i] = 0;
+  }
   SetDeadzone(0);
 }
 
@@ -75,26 +80,19 @@
     // load joystick names and open all connected joysticks
     for (int i = 0 ; i<SDL_NumJoysticks() ; i++)
     {
-      SDL_Joystick *joy = SDL_JoystickOpen(i);
+      if (i > 0) //Hack to stop extra joysticks from being polled. Controller is always joy 0 on my system but 4 show up...?
+       break;
 
-#ifdef __APPLE__
-      // On OS X, the 360 controllers are handled externally, since the SDL code is
-      // really buggy and doesn't handle disconnects.
-      //
-      if (std::string(SDL_JoystickName(i)).find("360") != std::string::npos)
-      {
-        CLog::Log(LOGNOTICE, "Ignoring joystick: %s", SDL_JoystickName(i));
-        continue;
-      }
-#endif
+      SDL_Joystick *joy = SDL_JoystickOpen(i);
 
       m_Joysticks.push_back(joy);
       if (joy)
       {
         m_JoystickNames.push_back(string(SDL_JoystickName(i)));
-        CLog::Log(LOGNOTICE, "Enabled Joystick: %s", SDL_JoystickName(i));
+        CLog::Log(LOGNOTICE, "Enabled Joystick: %s, Joystick Id: %d", SDL_JoystickName(i), i);
         CLog::Log(LOGNOTICE, "Details: Total Axis: %d Total Hats: %d Total Buttons: %d",
-            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));        
+            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));
+        CLog::Log(LOGNOTICE, "**SUPPORT FOR XBOX 360 CONTROLLER ONLY**");
       }
       else
       {
@@ -123,24 +121,27 @@
 {
   int buttonId    = -1;
   int axisId      = -1;
-  int hatId       = -1;
+  //int hatId       = -1;
   int numj        = m_Joysticks.size();
   if (numj <= 0)
     return;
 
+  numj = 1; //hack to disable needless polling as my system always has the joystick on joystick 0
+  CLog::Log(LOGDEBUG, "Entered CJoystick::Update()...");
+
   // update the state of all opened joysticks
   SDL_JoystickUpdate();
 
   // go through all joysticks
   for (int j = 0; j<numj; j++)
   {
+    CLog::Log(LOGDEBUG, "JoyStick Id = %d", j);
+    
     SDL_Joystick *joy = m_Joysticks[j];
     int numb = SDL_JoystickNumButtons(joy);
-    int numhat = SDL_JoystickNumHats(joy);
     int numax = SDL_JoystickNumAxes(joy);
     numax = (numax>MAX_AXES)?MAX_AXES:numax;
     int axisval;
-    uint8_t hatval;
 
     // get button states first, they take priority over axis
     for (int b = 0 ; b<numb ; b++)
@@ -154,18 +155,7 @@
       }
     }
     
-    for (int h = 0; h < numhat; h++)
-    {
-      hatval = SDL_JoystickGetHat(joy, h);
-      if (hatval != SDL_HAT_CENTERED)
-      {
-        m_JoyId = SDL_JoystickIndex(joy);
-        hatId = h + 1;
-        m_HatState = hatval;
-        j = numj-1;
-        break; 
-      }
-    }
+    //removed hat check
 
     // get axis states
     m_NumAxes = numax;
@@ -179,11 +169,17 @@
       }
       else
       {
-        m_Amount[axisId] = axisval;  //[-32768 to 32767]
+        m_Amount[axisId] = axisval;  //-32768 to 32767
+	
+        if (is_used == false && axisval != 0 && (axisId == 3 || axisId == 6))
+	  is_used = true; //set to true as an axis or button has been touched and it's no longer the default 0 init value
+	CLog::Log(LOGDEBUG, "Axis %d value = %d", axisId, axisval);
       }
     }
+
     m_AxisId = GetAxisWithMaxAmount();
-    if (m_AxisId)
+
+    if (m_AxisId) //if !0 set the joystick index and break out of the loop
     {
       m_JoyId = SDL_JoystickIndex(joy);
       j = numj-1;
@@ -191,24 +187,7 @@
     }
   }
 
-  if(hatId==-1)
-  {
-    if(m_HatId!=0)
-      CLog::Log(LOGDEBUG, "Joystick %d hat %u Centered", m_JoyId, hatId);
-    m_pressTicksHat = 0;
-    SetHatActive(false);
-    m_HatId = 0;
-  }
-  else
-  {
-    if(hatId!=m_HatId)
-    {
-      CLog::Log(LOGDEBUG, "Joystick %d hat %u Down", m_JoyId, hatId);
-      m_HatId = hatId;
-      m_pressTicksHat = SDL_GetTicks();
-    }
-    SetHatActive();
-  }
+  //removed hat code
 
   if (buttonId==-1)
   {
@@ -230,107 +209,18 @@
     }
     SetButtonActive();
   }
-
 }
 
 void CJoystick::Update(SDL_Event& joyEvent)
 {
-  int buttonId = -1;
-  int axisId = -1;
-  int joyId = -1;
-  DECLARE_UNUSED(bool,ignore = false)
-  DECLARE_UNUSED(bool,axis = false);
-
-  switch(joyEvent.type)
-  {
-  case SDL_JOYBUTTONDOWN:
-    m_JoyId = joyId = joyEvent.jbutton.which;
-    m_ButtonId = buttonId = joyEvent.jbutton.button + 1;
-    m_pressTicksButton = SDL_GetTicks();
-    SetButtonActive();
-    CLog::Log(LOGDEBUG, "Joystick %d button %d Down", joyId, buttonId);
-    break;
-
-  case SDL_JOYAXISMOTION:
-    joyId = joyEvent.jaxis.which;
-    axisId = joyEvent.jaxis.axis + 1;
-    m_NumAxes = SDL_JoystickNumAxes(m_Joysticks[joyId]);
-    if (axisId<=0 || axisId>=MAX_AXES)
-    {
-      CLog::Log(LOGERROR, "Axis Id out of range. Maximum supported axis: %d", MAX_AXES);
-      ignore = true;
-      break;
-    }
-    axis = true;
-    m_JoyId = joyId;
-    if (joyEvent.jaxis.value==0)
-    {
-      ignore = true;
-      m_Amount[axisId] = 0;
-    }
-    else
-    {
-      m_Amount[axisId] = joyEvent.jaxis.value; //[-32768 to 32767]
-    }
-    m_AxisId = GetAxisWithMaxAmount();
-    CLog::Log(LOGDEBUG, "Joystick %d Axis %d Amount %d", joyId, axisId, m_Amount[axisId]);
-    break;
-
-  case SDL_JOYHATMOTION:
-    m_JoyId = joyId = joyEvent.jbutton.which;
-    m_HatId = joyEvent.jhat.hat + 1;
-    m_pressTicksHat = SDL_GetTicks();
-    m_HatState = joyEvent.jhat.value;
-    SetHatActive(m_HatState != SDL_HAT_CENTERED);
-    CLog::Log(LOGDEBUG, "Joystick %d Hat %d Down with position %d", joyId, buttonId, m_HatState);
-    break;
-
-  case SDL_JOYBALLMOTION:
-    ignore = true;
-    break;
-    
-  case SDL_JOYBUTTONUP:
-    m_pressTicksButton = 0;
-    SetButtonActive(false);
-    CLog::Log(LOGDEBUG, "Joystick %d button %d Up", joyEvent.jbutton.which, m_ButtonId);
-
-  default:
-    ignore = true;
-    break;
-  }
+  //Stubbed out - never saw this called. Assuming it's used for event based detection. Why is that not the default?
+  //Seems that event based triggering would be more efficient than polling...?
 }
 
 bool CJoystick::GetHat(int &id, int &position,bool consider_repeat) 
 {
-  if (!IsHatActive())
-    return false;
-  position = m_HatState;
-  id = m_HatId;
-  if (!consider_repeat)
-    return true;
-
-  static uint32_t lastPressTicks = 0;
-  static uint32_t lastTicks = 0;
-  static uint32_t nowTicks = 0;
-
-  if ((m_HatId>=0) && m_pressTicksHat)
-  {
-    // return the id if it's the first press
-    if (lastPressTicks!=m_pressTicksHat)
-    {
-      lastPressTicks = m_pressTicksHat;
-      return true;
-    }
-    nowTicks = SDL_GetTicks();
-    if ((nowTicks-m_pressTicksHat)<500) // 500ms delay before we repeat
-      return false;
-    if ((nowTicks-lastTicks)<100) // 100ms delay before successive repeats
-      return false;
-
-    lastTicks = nowTicks;
-  }
-
-  return true;
+  //stubbed out
+  return false;
 } 
 
 bool CJoystick::GetButton(int &id, bool consider_repeat)
@@ -378,26 +268,57 @@
   axis = 0;
   maxAmount = 0;
   int tempf;
+  int tempval;
+
   for (int i = 1 ; i<=m_NumAxes ; i++)
   {
     tempf = abs(m_Amount[i]);
-    if (tempf>m_DeadzoneRange && tempf>maxAmount)
+    tempval = TriggerValue(m_Amount[i]);
+
+    //CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount - tempf = %d, non-abs value = %d,Axis = %d", tempf, tempval, i);
+
+    if ((i == 3 || i == 6) && tempval > 0) //TriggerValue accounts for init =0 case and then scales properly 
+    {
+      maxAmount = (tempval / 2); //divide by 2 as it won't handle > 32768
+      axis = i;
+      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_2 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], (maxAmount / 2));
+    }
+
+    if (tempf>m_DeadzoneRange && tempf>maxAmount && i != 3 && i != 6)
     {
       maxAmount = tempf;
       axis = i;
+      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_3 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], maxAmount);
     }
   }
+  
+  CLog::Log(LOGDEBUG, "SetAxisActive? - %d", (0 != maxAmount));
   SetAxisActive(0 != maxAmount);
   return axis;
 }
 
 float CJoystick::GetAmount(int axis)
 {
-  if (m_Amount[axis] > m_DeadzoneRange)
-    return (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
-  if (m_Amount[axis] < -m_DeadzoneRange)
-    return (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
-  return 0;
+  CLog::Log(LOGDEBUG, "GetAmount - Axis %d, m_Amount = %d, MAX_AXIS = %d, m_Deadzone = %d", axis, m_Amount[axis], MAX_AXISAMOUNT, m_DeadzoneRange);
+  float fval = 0;
+
+  if ((axis == 3 || axis == 6) && TriggerValue(m_Amount[axis]) != 0) //ignore 0
+    fval = (float)(TriggerValue(m_Amount[axis]))/(float)(65535); //trigger is re-scaled to all positive
+  else if ((m_Amount[axis] > m_DeadzoneRange) && axis != 3 && axis != 6)
+    fval = (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
+  else if ((m_Amount[axis] < -m_DeadzoneRange) && axis != 3 && axis != 6)
+    fval = (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
+
+  CLog::Log(LOGDEBUG, "GetAmount_2 - Axis %d, fval =  %f", axis, fval);
+  return fval;
+}
+
+int CJoystick::TriggerValue(int axisValue)
+{
+  if (is_used == true && axisValue  > -32268) //minimal deadzone (500) due to springs on the triggers
+    return (axisValue + 32768); //scale becomes 0 to 65535 because max positive = 32767
+  else
+    return 0;
 }
 
 float CJoystick::SetDeadzone(float val)
@@ -405,7 +326,9 @@
   if (val<0) val=0;
   if (val>1) val=1;
   m_DeadzoneRange = (int)(val*MAX_AXISAMOUNT);
+ 
+  CLog::Log(LOGDEBUG, "SetDeadzone value =  %f", val);
   return val;
 }
 
-#endif
+#endif
\ Kein Zeilenumbruch am Dateiende.
diff -Naur xbmc-1fef727/xbmc/input/SDLJoystick.h xbmc-1fef727.patch/xbmc/input/SDLJoystick.h
--- xbmc-1fef727/xbmc/input/SDLJoystick.h	2012-02-07 12:46:48.000000000 +0100
+++ xbmc-1fef727.patch/xbmc/input/SDLJoystick.h	2012-02-07 16:26:23.988820000 +0100
@@ -18,7 +18,8 @@
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
-
+//Modified Nov 18, 2011 by Andrew Lockwood
+//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
 #ifndef SDL_JOYSTICK_H
 #define SDL_JOYSTICK_H
 
@@ -43,7 +44,6 @@
 #define MAX_AXES 64
 #define MAX_AXISAMOUNT 32768
 
-
 // Class to manage all connected joysticks
 
 class CJoystick
@@ -72,6 +72,7 @@
   bool IsButtonActive() { return (m_ActiveFlags & JACTIVE_BUTTON) == JACTIVE_BUTTON; }
   bool IsAxisActive() { return (m_ActiveFlags & JACTIVE_AXIS) == JACTIVE_AXIS; }
   bool IsHatActive() { return (m_ActiveFlags & JACTIVE_HAT) == JACTIVE_HAT; }
+  int TriggerValue(int axisValue);
 
   int m_Amount[MAX_AXES];
   int m_AxisId;
@@ -86,10 +87,11 @@
   uint8_t m_ActiveFlags;
   std::vector<SDL_Joystick*> m_Joysticks;
   std::vector<std::string> m_JoystickNames;
+  bool is_used;
 };
 
 extern CJoystick g_Joystick;
 
 #endif
 
-#endif
+#endif
\ Kein Zeilenumbruch am Dateiende.

xbmc-pvr-cbe2cf3-992-Enable_xbox360_controller.patch:
diff -Naur xbmc-pvr-cbe2cf3/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml xbmc-pvr-cbe2cf3.patch/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml
--- xbmc-pvr-cbe2cf3/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml	2012-01-23 18:07:27.000000000 +0100
+++ xbmc-pvr-cbe2cf3.patch/system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml	2012-02-07 16:24:30.399305000 +0100
@@ -1,70 +1,43 @@
-<!-- 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.                                                                                     -->
+<!-- This file is designed to work only with the Xbox 360 Wireless Controller -->
+<!-- It will only work correctly with a modified SDLJoystick.cpp file that    -->
+<!-- has fixes in it for the 360 triggers                                     -->
 
-<!-- The format is:                      -->
-<!--    <device>                         -->
-<!--      <button>action</button>        -->
-<!--    </device>                        -->
-
-<!-- To map keys from other remotes using the RCA protocol, you may add <universalremote> blocks -->
-<!-- In this case, the tags used are <obc#> where # is the original button code (OBC) of the key -->
-<!-- You set it up by adding a <universalremote> block to the window or <global> section:       -->
-<!--    <universalremote>             -->
-<!--       <obc45>Stop</obc45>         -->
-<!--    </universalremote>            -->
-
-<!-- Note that the action can be a built-in function.                 -->
-<!--  eg <B>XBMC.ActivateWindow(MyMusic)</B>                         -->
-<!-- would automatically go to My Music on the press of the B button. -->
-
-<!-- Joysticks / Gamepads:                                                                    -->
-<!--   See the sample PS3 controller configuration below for the format.                      -->
-<!--                                                                                          -->
-<!--  Joystick Name:                                                                          -->
-<!--   Do 'cat /proc/bus/input/devices' or see your xbmc log file  to find the names of       -->
-<!--   detected joysticks. The name used in the configuration should match the detected name. -->
-<!--                                                                                          -->
-<!--  Button Ids:                                                                             -->
-<!--   'id' is the button ID used by SDL. Joystick button ids of connected joysticks appear   -->
-<!--   in xbmc.log when they are pressed. Use your log to map custom buttons to actions.      -->
-<!--                                                                                          -->
-<!--  Axis Ids / Analog Controls                                                              -->
-<!--   Coming soon.                                                                           -->
 <keymap>
   <global>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">Select</button> <!-- A -->
       <button id="2">Back</button> <!-- B -->
-      <button id="3"></button> <!-- X -->
-      <button id="4"></button> <!-- Y -->
-      <button id="5"></button> <!-- LB -->
+      <button id="3">Fullscreen</button> <!-- X -->
+      <button id="4">OSD</button> <!-- Y -->
+      <button id="5">ContextMenu</button> <!-- LB -->
       <button id="6"></button> <!-- RB -->
-      <button id="7"></button> <!-- ? -->
-      <button id="8"></button> <!-- ? -->
-      <button id="9">XBMC.ActivateWindow(PlayerControls)</button>
-      <button id="10"/>
-      <button id="11">Up</button>
-      <button id="12">Down</button>
-      <button id="13">Left</button>
-      <button id="14">Right</button>
-      <button id="15"></button>
-      <button id="16"></button>
-      <button id="17">PreviousMenu</button>
-      <axis limit="-1" id="5">VolumeUp</axis>
-      <axis limit="+1" id="5">VolumeDown</axis>
-      <axis limit="-1" id="4">AnalogSeekBack</axis>
-      <axis limit="+1" id="4">AnalogSeekForward</axis>
-      <axis limit="0" id="3">ScrollUp</axis>
-      <axis limit="0" id="6">ScrollDown</axis>
-    </joystick>
+      <button id="7">Back</button> <!-- Back -->
+      <button id="8"></button> <!-- Start -->
+      <button id="9">XBMC.ActivateWindow(Home)</button>  <!-- Xbox 360 Button -->
+      <button id="10"></button> <!-- Left Tumbstick Click -->
+      <button id="11">Screenshot</button> <!-- Right Thumbstick Click -->
+      <button id="12">Left</button> <!-- Dpad Left -->
+      <button id="13">Right</button> <!-- Dpad Right -->
+      <button id="14">Up</button> <!-- Dpad Up -->
+      <button id="15">Down</button> <!-- Dpad Down -->
+      
+      <axis limit="-1" id="1"></axis> <!-- Left stick, left -->
+	  <axis limit="1" id="1"></axis> <!-- Left stick, right -->
+	  <axis limit="-1" id="2">ScrollUp</axis> <!-- Left stick, up -->
+	  <axis limit="1" id="2">ScrollDown</axis> <!-- Left stick, down -->
+	  
+	  <axis limit="-1" id="4">AnalogSeekBack</axis> <!-- Right stick, left -->
+	  <axis limit="1" id="4">AnalogSeekForward</axis> <!-- Right stick, right -->
+	  <axis limit="-1" id="5">VolumeUp</axis> <!-- Right stick, up -->
+      <axis limit="1" id="5">VolumeDown</axis> <!-- Right stick, down -->
+      	  
+	  <axis limit="1" id="3">ScrollUp</axis> <!-- Left Trigger -->
+	  <axis limit="1" id="6">ScrollDown</axis> <!-- Right Trigger -->
+  </joystick>
   </global>
   <Home>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">XBMC.Skin.ToggleSetting(HomeViewToggle)</button>
+      <!-- <button id="3">XBMC.Skin.ToggleSetting(HomeViewToggle)</button> -->
     </joystick>
   </Home>
   <MyFiles>
@@ -75,19 +48,19 @@
   <MyMusicPlaylist>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="3">Back</button>
-      <button id="5">Delete</button>
+      <!-- <button id="5">Delete</button> -->
     </joystick>
   </MyMusicPlaylist>
   <MyMusicFiles>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Playlist</button>
-      <button id="5">Queue</button>
+      <button id="3">FullScreen</button>
+      <button id="5">ContextMenu</button>
     </joystick>
   </MyMusicFiles>
   <MyMusicLibrary>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Playlist</button>
-      <button id="5">Queue</button>
+      <!-- <button id="3">Playlist</button> -->
+      <button id="5">ContextMenu</button>
     </joystick>
   </MyMusicLibrary>
   <FullscreenVideo>
@@ -98,183 +71,179 @@
       <button id="5">AspectRatio</button>
       <button id="6">Info</button>
       <button id="9">OSD</button>
-      <button id="13">BigStepForward</button>
-      <button id="14">StepForward</button>
+      <button id="14">BigStepForward</button>
+      <button id="13">StepForward</button>
       <button id="15">BigStepBack</button>
-      <button id="16">StepBack</button>
-      <button id="17">SmallStepBack</button>
-      <axis limit="0" id="3">AnalogRewind</axis>
-      <axis limit="0" id="6">AnalogFastForward</axis>
+      <button id="12">StepBack</button>      
+      <axis limit="1" id="3">AnalogRewind</axis>
+      <axis limit="1" id="6">AnalogFastForward</axis>
     </joystick>
   </FullscreenVideo>
   <FullscreenInfo>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">CodecInfo</button>
-      <button id="6">Back</button>
-      <button id="9">OSD</button>
-      <axis limit="0" id="3">AnalogRewind</axis>
-      <axis limit="0" id="6">AnalogFastForward</axis>
+      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
+      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
     </joystick>
   </FullscreenInfo>
   <PlayerControls>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
     </joystick>
   </PlayerControls>
   <Visualisation>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">Pause</button>
       <button id="2">Stop</button>
-      <button id="3">CodecInfo</button>
+      <button id="3">FullScreen</button>
+	  <button id="4">CodecInfo</button>
       <button id="5">XBMC.ActivateWindow(VisualisationPresetList)</button>
       <button id="6">Info</button>
-      <button id="9">XBMC.ActivateWindow(MusicOSD)</button>
-      <button id="13">NextPreset</button>
-      <button id="14">SkipNext</button>
-      <button id="15">PreviousPreset</button>
-      <button id="16">SkipPrevious</button>
-      <axis limit="0" id="3">AnalogRewind</axis>
-      <axis limit="0" id="6">AnalogFastForward</axis>
+      <button id="4">XBMC.ActivateWindow(MusicOSD)</button>
+      <button id="12">SkipPrevious</button>
+	  <button id="13">SkipNext</button>
+	  <button id="14">PreviousPreset</button>
+	  <button id="15">NextPreset</button>
+      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
+      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
     </joystick>
   </Visualisation>
   <MusicOSD>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="19">Back</button>
-      <button id="3">CodecInfo</button>
-      <button id="6">Info</button>
+      <!-- <button id="2">Back</button> -->
+      <!-- <button id="3">CodecInfo</button> -->
+      <!-- <button id="6">Info</button> -->
     </joystick>
   </MusicOSD>
   <VisualisationSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Back</button>
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
+      <!-- <button id="9">Back</button> -->
     </joystick>
   </VisualisationSettings>
   <VisualisationPresetList>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Back</button>
-      <button id="5">Back</button>
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
+      <!-- <button id="3">Back</button> -->
+      <!-- <button id="9">Back</button> -->
     </joystick>
   </VisualisationPresetList>
   <SlideShow>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="1">Pause</button>
-      <button id="2">Stop</button>
-      <button id="3">CodecInfo</button>
-      <button id="4">ZoomNormal</button>
-      <button id="5">Rotate</button>
-      <button id="6">Info</button>
-      <button id="13">ZoomIn</button>
-      <button id="14">NextPicture</button>
-      <button id="15">ZoomOut</button>
-      <button id="16">PreviousPicture</button>
-      <button id="17">Stop</button>
+      <!-- <button id="1">Pause</button> -->
+      <!-- <button id="2">Stop</button> -->
+      <!-- <button id="10">CodecInfo</button> -->
+      <!-- <button id="9">ZoomNormal</button> -->
+      <!-- <button id="14">Rotate</button> -->
+      <!-- <button id="4">Info</button> -->
+      <!-- <button id="5">ZoomIn</button> -->
+      <!-- <button id="13">NextPicture</button> -->
+      <!-- <button id="6">ZoomOut</button> -->
+      <!-- <button id="12">PreviousPicture</button> -->
     </joystick>
   </SlideShow>
   <ScreenCalibration>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">NextCalibration</button>
       <button id="3">ResetCalibration</button>
-      <button id="6">NextResolution</button>
+      <button id="4">NextResolution</button>
     </joystick>
   </ScreenCalibration>
   <GUICalibration>
     <joystick name="Xbox 360 Wireless Receiver">
       <button id="1">NextCalibration</button>
       <button id="3">ResetCalibration</button>
-      <button id="6">NextResolution</button>
+      <button id="4">NextResolution</button>
     </joystick>
   </GUICalibration>
   <VideoOSD>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="2">Back</button> -->
     </joystick>
   </VideoOSD>
   <VideoMenu>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="5">AspectRatio</button>
-      <button id="2">Stop</button>
-      <button id="9">OSD</button>
-      <button id="6">Info</button>
-      <button id="3">CodecInfo</button>
+      <!-- <button id="5">AspectRatio</button> -->
+      <!-- <button id="2">Stop</button> -->
+      <!-- <button id="9">OSD</button> -->
+      <!-- <button id="4">Info</button> -->
+      <!-- <button id="3">CodecInfo</button> -->
     </joystick>
   </VideoMenu>
   <OSDVideoSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="4"/>
-      <button id="5">AspectRatio</button>
-      <button id="19">Back</button>
+      <!-- <button id="4"/> -->
+      <!-- <button id="5">AspectRatio</button> -->
+      <!-- <button id="19">Back</button> -->
     </joystick>
   </OSDVideoSettings>
   <OSDAudioSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="4"/>
-      <button id="5">AspectRatio</button>
-      <button id="19">Back</button>
+      <!-- <button id="4"/> -->
+      <!-- <button id="5">AspectRatio</button> -->
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </OSDAudioSettings>
   <VideoBookmarks>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="4"/>
-      <button id="5">Delete</button>
-      <button id="19">Back</button>
+      <!-- <button id="4"/> -->
+      <!-- <button id="5">Delete</button> -->
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </VideoBookmarks>
   <MyVideoLibrary>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">Delete</button>
+      <!-- <button id="3">Delete</button> -->
     </joystick>
   </MyVideoLibrary>
   <MyVideoFiles>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="5">Queue</button>
-      <button id="3">Playlist</button>
+      <!-- <button id="5">Queue</button> -->
+      <!-- <button id="3">Playlist</button> -->
     </joystick>
   </MyVideoFiles>
   <MyVideoPlaylist>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="5">Delete</button>
-      <button id="3">Back</button>
+      <!-- <button id="5">Delete</button> -->
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </MyVideoPlaylist>
   <VirtualKeyboard>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Enter</button>
-      <button id="2">BackSpace</button>
+      <button id="8">Enter</button>
+      <button id="3">BackSpace</button>
       <button id="5">Shift</button>
-      <button id="4">Symbols</button>
+      <button id="6">Symbols</button>
     </joystick>
   </VirtualKeyboard>
   <ContextMenu>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="6">Back</button>
+      <button id="7">Back</button> -->
     </joystick>
   </ContextMenu>
   <Scripts>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="3">XBMC.ActivateWindow(ScriptsDebugInfo)</button>
+      <button id="4">XBMC.ActivateWindow(ScriptsDebugInfo)</button>
     </joystick>
   </Scripts>
   <NumericInput>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="2">BackSpace</button>
-      <button id="9">Enter</button>
+      <button id="3">BackSpace</button>
+      <button id="8">Enter</button>
     </joystick>
   </NumericInput>
   <GamepadInput>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Stop</button>      <!-- Enter Password -->
+      <!-- <button id="9">Stop</button> -->
     </joystick>
   </GamepadInput>
   <LockSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </LockSettings>
   <ProfileSettings>
     <joystick name="Xbox 360 Wireless Receiver">
-      <button id="9">Back</button>
+      <!-- <button id="7">Back</button> -->
     </joystick>
   </ProfileSettings>
-</keymap>
+</keymap>
\ Kein Zeilenumbruch am Dateiende.
diff -Naur xbmc-pvr-cbe2cf3/xbmc/input/SDLJoystick.cpp xbmc-pvr-cbe2cf3.patch/xbmc/input/SDLJoystick.cpp
--- xbmc-pvr-cbe2cf3/xbmc/input/SDLJoystick.cpp	2012-01-23 18:06:59.000000000 +0100
+++ xbmc-pvr-cbe2cf3.patch/xbmc/input/SDLJoystick.cpp	2012-02-07 16:22:58.738363000 +0100
@@ -18,6 +18,8 @@
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
+//Modified Nov 18, 2011 by Andrew Lockwood
+//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
 
 #include "system.h"
 #include "SDLJoystick.h"
@@ -43,8 +45,11 @@
   m_HatId = 0;
   m_HatState = SDL_HAT_CENTERED;
   m_ActiveFlags = JACTIVE_NONE;
-  for (int i = 0 ; i<MAX_AXES ; i++)
-    m_Amount[i] = 0;
+  is_used = false;
+ for (int i = 0 ; i<MAX_AXES ; i++)
+  {
+   m_Amount[i] = 0;
+  }
   SetDeadzone(0);
 }
 
@@ -75,26 +80,19 @@
     // load joystick names and open all connected joysticks
     for (int i = 0 ; i<SDL_NumJoysticks() ; i++)
     {
-      SDL_Joystick *joy = SDL_JoystickOpen(i);
+      if (i > 0) //Hack to stop extra joysticks from being polled. Controller is always joy 0 on my system but 4 show up...?
+       break;
 
-#ifdef __APPLE__
-      // On OS X, the 360 controllers are handled externally, since the SDL code is
-      // really buggy and doesn't handle disconnects.
-      //
-      if (std::string(SDL_JoystickName(i)).find("360") != std::string::npos)
-      {
-        CLog::Log(LOGNOTICE, "Ignoring joystick: %s", SDL_JoystickName(i));
-        continue;
-      }
-#endif
+      SDL_Joystick *joy = SDL_JoystickOpen(i);
 
       m_Joysticks.push_back(joy);
       if (joy)
       {
         m_JoystickNames.push_back(string(SDL_JoystickName(i)));
-        CLog::Log(LOGNOTICE, "Enabled Joystick: %s", SDL_JoystickName(i));
+        CLog::Log(LOGNOTICE, "Enabled Joystick: %s, Joystick Id: %d", SDL_JoystickName(i), i);
         CLog::Log(LOGNOTICE, "Details: Total Axis: %d Total Hats: %d Total Buttons: %d",
-            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));        
+            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));
+        CLog::Log(LOGNOTICE, "**SUPPORT FOR XBOX 360 CONTROLLER ONLY**");
       }
       else
       {
@@ -123,24 +121,27 @@
 {
   int buttonId    = -1;
   int axisId      = -1;
-  int hatId       = -1;
+  //int hatId       = -1;
   int numj        = m_Joysticks.size();
   if (numj <= 0)
     return;
 
+  numj = 1; //hack to disable needless polling as my system always has the joystick on joystick 0
+  CLog::Log(LOGDEBUG, "Entered CJoystick::Update()...");
+
   // update the state of all opened joysticks
   SDL_JoystickUpdate();
 
   // go through all joysticks
   for (int j = 0; j<numj; j++)
   {
+    CLog::Log(LOGDEBUG, "JoyStick Id = %d", j);
+    
     SDL_Joystick *joy = m_Joysticks[j];
     int numb = SDL_JoystickNumButtons(joy);
-    int numhat = SDL_JoystickNumHats(joy);
     int numax = SDL_JoystickNumAxes(joy);
     numax = (numax>MAX_AXES)?MAX_AXES:numax;
     int axisval;
-    uint8_t hatval;
 
     // get button states first, they take priority over axis
     for (int b = 0 ; b<numb ; b++)
@@ -154,18 +155,7 @@
       }
     }
     
-    for (int h = 0; h < numhat; h++)
-    {
-      hatval = SDL_JoystickGetHat(joy, h);
-      if (hatval != SDL_HAT_CENTERED)
-      {
-        m_JoyId = SDL_JoystickIndex(joy);
-        hatId = h + 1;
-        m_HatState = hatval;
-        j = numj-1;
-        break; 
-      }
-    }
+    //removed hat check
 
     // get axis states
     m_NumAxes = numax;
@@ -179,11 +169,17 @@
       }
       else
       {
-        m_Amount[axisId] = axisval;  //[-32768 to 32767]
+        m_Amount[axisId] = axisval;  //-32768 to 32767
+	
+        if (is_used == false && axisval != 0 && (axisId == 3 || axisId == 6))
+	  is_used = true; //set to true as an axis or button has been touched and it's no longer the default 0 init value
+	CLog::Log(LOGDEBUG, "Axis %d value = %d", axisId, axisval);
       }
     }
+
     m_AxisId = GetAxisWithMaxAmount();
-    if (m_AxisId)
+
+    if (m_AxisId) //if !0 set the joystick index and break out of the loop
     {
       m_JoyId = SDL_JoystickIndex(joy);
       j = numj-1;
@@ -191,24 +187,7 @@
     }
   }
 
-  if(hatId==-1)
-  {
-    if(m_HatId!=0)
-      CLog::Log(LOGDEBUG, "Joystick %d hat %u Centered", m_JoyId, hatId);
-    m_pressTicksHat = 0;
-    SetHatActive(false);
-    m_HatId = 0;
-  }
-  else
-  {
-    if(hatId!=m_HatId)
-    {
-      CLog::Log(LOGDEBUG, "Joystick %d hat %u Down", m_JoyId, hatId);
-      m_HatId = hatId;
-      m_pressTicksHat = SDL_GetTicks();
-    }
-    SetHatActive();
-  }
+  //removed hat code
 
   if (buttonId==-1)
   {
@@ -230,107 +209,18 @@
     }
     SetButtonActive();
   }
-
 }
 
 void CJoystick::Update(SDL_Event& joyEvent)
 {
-  int buttonId = -1;
-  int axisId = -1;
-  int joyId = -1;
-  DECLARE_UNUSED(bool,ignore = false)
-  DECLARE_UNUSED(bool,axis = false);
-
-  switch(joyEvent.type)
-  {
-  case SDL_JOYBUTTONDOWN:
-    m_JoyId = joyId = joyEvent.jbutton.which;
-    m_ButtonId = buttonId = joyEvent.jbutton.button + 1;
-    m_pressTicksButton = SDL_GetTicks();
-    SetButtonActive();
-    CLog::Log(LOGDEBUG, "Joystick %d button %d Down", joyId, buttonId);
-    break;
-
-  case SDL_JOYAXISMOTION:
-    joyId = joyEvent.jaxis.which;
-    axisId = joyEvent.jaxis.axis + 1;
-    m_NumAxes = SDL_JoystickNumAxes(m_Joysticks[joyId]);
-    if (axisId<=0 || axisId>=MAX_AXES)
-    {
-      CLog::Log(LOGERROR, "Axis Id out of range. Maximum supported axis: %d", MAX_AXES);
-      ignore = true;
-      break;
-    }
-    axis = true;
-    m_JoyId = joyId;
-    if (joyEvent.jaxis.value==0)
-    {
-      ignore = true;
-      m_Amount[axisId] = 0;
-    }
-    else
-    {
-      m_Amount[axisId] = joyEvent.jaxis.value; //[-32768 to 32767]
-    }
-    m_AxisId = GetAxisWithMaxAmount();
-    CLog::Log(LOGDEBUG, "Joystick %d Axis %d Amount %d", joyId, axisId, m_Amount[axisId]);
-    break;
-
-  case SDL_JOYHATMOTION:
-    m_JoyId = joyId = joyEvent.jbutton.which;
-    m_HatId = joyEvent.jhat.hat + 1;
-    m_pressTicksHat = SDL_GetTicks();
-    m_HatState = joyEvent.jhat.value;
-    SetHatActive(m_HatState != SDL_HAT_CENTERED);
-    CLog::Log(LOGDEBUG, "Joystick %d Hat %d Down with position %d", joyId, buttonId, m_HatState);
-    break;
-
-  case SDL_JOYBALLMOTION:
-    ignore = true;
-    break;
-    
-  case SDL_JOYBUTTONUP:
-    m_pressTicksButton = 0;
-    SetButtonActive(false);
-    CLog::Log(LOGDEBUG, "Joystick %d button %d Up", joyEvent.jbutton.which, m_ButtonId);
-
-  default:
-    ignore = true;
-    break;
-  }
+  //Stubbed out - never saw this called. Assuming it's used for event based detection. Why is that not the default?
+  //Seems that event based triggering would be more efficient than polling...?
 }
 
 bool CJoystick::GetHat(int &id, int &position,bool consider_repeat) 
 {
-  if (!IsHatActive())
-    return false;
-  position = m_HatState;
-  id = m_HatId;
-  if (!consider_repeat)
-    return true;
-
-  static uint32_t lastPressTicks = 0;
-  static uint32_t lastTicks = 0;
-  static uint32_t nowTicks = 0;
-
-  if ((m_HatId>=0) && m_pressTicksHat)
-  {
-    // return the id if it's the first press
-    if (lastPressTicks!=m_pressTicksHat)
-    {
-      lastPressTicks = m_pressTicksHat;
-      return true;
-    }
-    nowTicks = SDL_GetTicks();
-    if ((nowTicks-m_pressTicksHat)<500) // 500ms delay before we repeat
-      return false;
-    if ((nowTicks-lastTicks)<100) // 100ms delay before successive repeats
-      return false;
-
-    lastTicks = nowTicks;
-  }
-
-  return true;
+  //stubbed out
+  return false;
 } 
 
 bool CJoystick::GetButton(int &id, bool consider_repeat)
@@ -378,26 +268,57 @@
   axis = 0;
   maxAmount = 0;
   int tempf;
+  int tempval;
+
   for (int i = 1 ; i<=m_NumAxes ; i++)
   {
     tempf = abs(m_Amount[i]);
-    if (tempf>m_DeadzoneRange && tempf>maxAmount)
+    tempval = TriggerValue(m_Amount[i]);
+
+    //CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount - tempf = %d, non-abs value = %d,Axis = %d", tempf, tempval, i);
+
+    if ((i == 3 || i == 6) && tempval > 0) //TriggerValue accounts for init =0 case and then scales properly 
+    {
+      maxAmount = (tempval / 2); //divide by 2 as it won't handle > 32768
+      axis = i;
+      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_2 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], (maxAmount / 2));
+    }
+
+    if (tempf>m_DeadzoneRange && tempf>maxAmount && i != 3 && i != 6)
     {
       maxAmount = tempf;
       axis = i;
+      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_3 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], maxAmount);
     }
   }
+  
+  CLog::Log(LOGDEBUG, "SetAxisActive? - %d", (0 != maxAmount));
   SetAxisActive(0 != maxAmount);
   return axis;
 }
 
 float CJoystick::GetAmount(int axis)
 {
-  if (m_Amount[axis] > m_DeadzoneRange)
-    return (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
-  if (m_Amount[axis] < -m_DeadzoneRange)
-    return (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
-  return 0;
+  CLog::Log(LOGDEBUG, "GetAmount - Axis %d, m_Amount = %d, MAX_AXIS = %d, m_Deadzone = %d", axis, m_Amount[axis], MAX_AXISAMOUNT, m_DeadzoneRange);
+  float fval = 0;
+
+  if ((axis == 3 || axis == 6) && TriggerValue(m_Amount[axis]) != 0) //ignore 0
+    fval = (float)(TriggerValue(m_Amount[axis]))/(float)(65535); //trigger is re-scaled to all positive
+  else if ((m_Amount[axis] > m_DeadzoneRange) && axis != 3 && axis != 6)
+    fval = (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
+  else if ((m_Amount[axis] < -m_DeadzoneRange) && axis != 3 && axis != 6)
+    fval = (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
+
+  CLog::Log(LOGDEBUG, "GetAmount_2 - Axis %d, fval =  %f", axis, fval);
+  return fval;
+}
+
+int CJoystick::TriggerValue(int axisValue)
+{
+  if (is_used == true && axisValue  > -32268) //minimal deadzone (500) due to springs on the triggers
+    return (axisValue + 32768); //scale becomes 0 to 65535 because max positive = 32767
+  else
+    return 0;
 }
 
 float CJoystick::SetDeadzone(float val)
@@ -405,7 +326,9 @@
   if (val<0) val=0;
   if (val>1) val=1;
   m_DeadzoneRange = (int)(val*MAX_AXISAMOUNT);
+ 
+  CLog::Log(LOGDEBUG, "SetDeadzone value =  %f", val);
   return val;
 }
 
-#endif
+#endif
\ Kein Zeilenumbruch am Dateiende.
diff -Naur xbmc-pvr-cbe2cf3/xbmc/input/SDLJoystick.h xbmc-pvr-cbe2cf3.patch/xbmc/input/SDLJoystick.h
--- xbmc-pvr-cbe2cf3/xbmc/input/SDLJoystick.h	2012-01-23 18:06:59.000000000 +0100
+++ xbmc-pvr-cbe2cf3.patch/xbmc/input/SDLJoystick.h	2012-02-07 16:23:34.008612000 +0100
@@ -18,7 +18,8 @@
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
-
+//Modified Nov 18, 2011 by Andrew Lockwood
+//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
 #ifndef SDL_JOYSTICK_H
 #define SDL_JOYSTICK_H
 
@@ -43,7 +44,6 @@
 #define MAX_AXES 64
 #define MAX_AXISAMOUNT 32768
 
-
 // Class to manage all connected joysticks
 
 class CJoystick
@@ -72,6 +72,7 @@
   bool IsButtonActive() { return (m_ActiveFlags & JACTIVE_BUTTON) == JACTIVE_BUTTON; }
   bool IsAxisActive() { return (m_ActiveFlags & JACTIVE_AXIS) == JACTIVE_AXIS; }
   bool IsHatActive() { return (m_ActiveFlags & JACTIVE_HAT) == JACTIVE_HAT; }
+  int TriggerValue(int axisValue);
 
   int m_Amount[MAX_AXES];
   int m_AxisId;
@@ -86,10 +87,11 @@
   uint8_t m_ActiveFlags;
   std::vector<SDL_Joystick*> m_Joysticks;
   std::vector<std::string> m_JoystickNames;
+  bool is_used;
 };
 
 extern CJoystick g_Joystick;
 
 #endif
 
-#endif
+#endif
\ Kein Zeilenumbruch am Dateiende.
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 4 years 10 months ago #13

  • haywire
  • haywire's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
de45dd: I tried adding both patches to

./packages/mediacenter/xbmc/patches

I noticed the 1.95 (2.0 beta 4) directory structure changed and there is no longer an xbmc-pvr directory and that both basic and pvr patches go inside there

then i renamed with
./rename.sh 1fef727 11.0.1
./rename.sh cbe2cf3 11.0.1

on

xbmc-1fef727-982-Enable_xbox360_controller.patch
xbmc-pvr-cbe2cf3-992-Enable_xbox360_controller.patch

then i tried compiling but it hangs up when trying to apply the patch

any idea if theres something i missed





APPLY PATCH: packages/mediacenter/xbmc/patches/xbmc-11.0.1-982-Enable_xbox360_controller.patch
patching file system/keymaps/joystick.Microsoft.Xbox.360.Controller.xml
patching file xbmc/input/SDLJoystick.cpp
Hunk #10 FAILED at 326.
1 out of 10 hunks FAILED -- saving rejects to file xbmc/input/SDLJoystick.cpp.rej
patching file xbmc/input/SDLJoystick.h
Hunk #3 succeeded at 73 (offset 1 line).
Hunk #4 succeeded at 88 (offset 1 line).
make: *** [release] Error 1
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 4 years 10 months ago #14

  • haywire
  • haywire's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
Heres the xbmc/input/SDLJoystick.cpp.rej

not quite sure why it didnt take



--- xbmc/input/SDLJoystick.cpp	2012-02-07 12:46:48.000000000 +0100
+++ xbmc/input/SDLJoystick.cpp	2012-02-07 16:26:02.181313000 +0100
@@ -326,7 +247,9 @@
   if (val<0) val=0;
   if (val>1) val=1;
   m_DeadzoneRange = (int)(val*MAX_AXISAMOUNT);
+ 
+  CLog::Log(LOGDEBUG, "SetDeadzone value =  %f", val);
   return val;
 }
 
-#endif
+#endif
The administrator has disabled public write access.

Re: [SOLVED] Xbox 360 Wireless Controller Navigation 4 years 10 months ago #15

  • de45dd
  • de45dd's Avatar
  • Offline
  • Junior Boarder
  • Posts: 21
  • Thank you received: 1
  • Karma: 0
Hi,

I successfully compiled PVR-Version (now ./packages/mediacenter/xbmc/patches) with this old patch yesterday (patch was made for xbmc-pvr version but also applied on current xbmc-version)
This patch will not include xbox360.xml file. I copied it manually after installing openelec on the client (\\%ClientIP%\Userdata\keymaps\xbox360.xml)

Heres the patch "xbmc-pvr-c50f565-992-xbox360_controller_patch.patch":
diff -Naur xbmc-pvr-c50f565/xbmc/input/SDLJoystick.cpp xbmc-pvr-c50f565.patch/xbmc/input/SDLJoystick.cpp
--- xbmc-pvr-c50f565/xbmc/input/SDLJoystick.cpp	2012-03-14 09:28:54.463565919 +0100
+++ xbmc-pvr-c50f565.patch/xbmc/input/SDLJoystick.cpp	2012-03-14 09:30:28.501167000 +0100
@@ -18,6 +18,8 @@
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
+//Modified Nov 18, 2011 by Andrew Lockwood
+//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
 
 #include "system.h"
 #include "SDLJoystick.h"
@@ -43,8 +45,11 @@
   m_HatId = 0;
   m_HatState = SDL_HAT_CENTERED;
   m_ActiveFlags = JACTIVE_NONE;
-  for (int i = 0 ; i<MAX_AXES ; i++)
-    m_Amount[i] = 0;
+  is_used = false;
+ for (int i = 0 ; i<MAX_AXES ; i++)
+  {
+   m_Amount[i] = 0;
+  }
   SetDeadzone(0);
 }
 
@@ -75,26 +80,19 @@
     // load joystick names and open all connected joysticks
     for (int i = 0 ; i<SDL_NumJoysticks() ; i++)
     {
-      SDL_Joystick *joy = SDL_JoystickOpen(i);
+      if (i > 0) //Hack to stop extra joysticks from being polled. Controller is always joy 0 on my system but 4 show up...?
+       break;
 
-#ifdef __APPLE__
-      // On OS X, the 360 controllers are handled externally, since the SDL code is
-      // really buggy and doesn't handle disconnects.
-      //
-      if (std::string(SDL_JoystickName(i)).find("360") != std::string::npos)
-      {
-        CLog::Log(LOGNOTICE, "Ignoring joystick: %s", SDL_JoystickName(i));
-        continue;
-      }
-#endif
+      SDL_Joystick *joy = SDL_JoystickOpen(i);
 
       m_Joysticks.push_back(joy);
       if (joy)
       {
         m_JoystickNames.push_back(string(SDL_JoystickName(i)));
-        CLog::Log(LOGNOTICE, "Enabled Joystick: %s", SDL_JoystickName(i));
+        CLog::Log(LOGNOTICE, "Enabled Joystick: %s, Joystick Id: %d", SDL_JoystickName(i), i);
         CLog::Log(LOGNOTICE, "Details: Total Axis: %d Total Hats: %d Total Buttons: %d",
-            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));        
+            SDL_JoystickNumAxes(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumButtons(joy));
+        CLog::Log(LOGNOTICE, "**SUPPORT FOR XBOX 360 CONTROLLER ONLY**");
       }
       else
       {
@@ -123,24 +121,27 @@
 {
   int buttonId    = -1;
   int axisId      = -1;
-  int hatId       = -1;
+  //int hatId       = -1;
   int numj        = m_Joysticks.size();
   if (numj <= 0)
     return;
 
+  numj = 1; //hack to disable needless polling as my system always has the joystick on joystick 0
+  CLog::Log(LOGDEBUG, "Entered CJoystick::Update()...");
+
   // update the state of all opened joysticks
   SDL_JoystickUpdate();
 
   // go through all joysticks
   for (int j = 0; j<numj; j++)
   {
+    CLog::Log(LOGDEBUG, "JoyStick Id = %d", j);
+    
     SDL_Joystick *joy = m_Joysticks[j];
     int numb = SDL_JoystickNumButtons(joy);
-    int numhat = SDL_JoystickNumHats(joy);
     int numax = SDL_JoystickNumAxes(joy);
     numax = (numax>MAX_AXES)?MAX_AXES:numax;
     int axisval;
-    uint8_t hatval;
 
     // get button states first, they take priority over axis
     for (int b = 0 ; b<numb ; b++)
@@ -154,18 +155,7 @@
       }
     }
     
-    for (int h = 0; h < numhat; h++)
-    {
-      hatval = SDL_JoystickGetHat(joy, h);
-      if (hatval != SDL_HAT_CENTERED)
-      {
-        m_JoyId = SDL_JoystickIndex(joy);
-        hatId = h + 1;
-        m_HatState = hatval;
-        j = numj-1;
-        break; 
-      }
-    }
+    //removed hat check
 
     // get axis states
     m_NumAxes = numax;
@@ -179,11 +169,17 @@
       }
       else
       {
-        m_Amount[axisId] = axisval;  //[-32768 to 32767]
+        m_Amount[axisId] = axisval;  //-32768 to 32767
+	
+        if (is_used == false && axisval != 0 && (axisId == 3 || axisId == 6))
+	  is_used = true; //set to true as an axis or button has been touched and it's no longer the default 0 init value
+	CLog::Log(LOGDEBUG, "Axis %d value = %d", axisId, axisval);
       }
     }
+
     m_AxisId = GetAxisWithMaxAmount();
-    if (m_AxisId)
+
+    if (m_AxisId) //if !0 set the joystick index and break out of the loop
     {
       m_JoyId = SDL_JoystickIndex(joy);
       j = numj-1;
@@ -191,24 +187,7 @@
     }
   }
 
-  if(hatId==-1)
-  {
-    if(m_HatId!=0)
-      CLog::Log(LOGDEBUG, "Joystick %d hat %u Centered", m_JoyId, hatId);
-    m_pressTicksHat = 0;
-    SetHatActive(false);
-    m_HatId = 0;
-  }
-  else
-  {
-    if(hatId!=m_HatId)
-    {
-      CLog::Log(LOGDEBUG, "Joystick %d hat %u Down", m_JoyId, hatId);
-      m_HatId = hatId;
-      m_pressTicksHat = SDL_GetTicks();
-    }
-    SetHatActive();
-  }
+  //removed hat code
 
   if (buttonId==-1)
   {
@@ -230,107 +209,18 @@
     }
     SetButtonActive();
   }
-
 }
 
 void CJoystick::Update(SDL_Event& joyEvent)
 {
-  int buttonId = -1;
-  int axisId = -1;
-  int joyId = -1;
-  DECLARE_UNUSED(bool,ignore = false)
-  DECLARE_UNUSED(bool,axis = false);
-
-  switch(joyEvent.type)
-  {
-  case SDL_JOYBUTTONDOWN:
-    m_JoyId = joyId = joyEvent.jbutton.which;
-    m_ButtonId = buttonId = joyEvent.jbutton.button + 1;
-    m_pressTicksButton = SDL_GetTicks();
-    SetButtonActive();
-    CLog::Log(LOGDEBUG, "Joystick %d button %d Down", joyId, buttonId);
-    break;
-
-  case SDL_JOYAXISMOTION:
-    joyId = joyEvent.jaxis.which;
-    axisId = joyEvent.jaxis.axis + 1;
-    m_NumAxes = SDL_JoystickNumAxes(m_Joysticks[joyId]);
-    if (axisId<=0 || axisId>=MAX_AXES)
-    {
-      CLog::Log(LOGERROR, "Axis Id out of range. Maximum supported axis: %d", MAX_AXES);
-      ignore = true;
-      break;
-    }
-    axis = true;
-    m_JoyId = joyId;
-    if (joyEvent.jaxis.value==0)
-    {
-      ignore = true;
-      m_Amount[axisId] = 0;
-    }
-    else
-    {
-      m_Amount[axisId] = joyEvent.jaxis.value; //[-32768 to 32767]
-    }
-    m_AxisId = GetAxisWithMaxAmount();
-    CLog::Log(LOGDEBUG, "Joystick %d Axis %d Amount %d", joyId, axisId, m_Amount[axisId]);
-    break;
-
-  case SDL_JOYHATMOTION:
-    m_JoyId = joyId = joyEvent.jbutton.which;
-    m_HatId = joyEvent.jhat.hat + 1;
-    m_pressTicksHat = SDL_GetTicks();
-    m_HatState = joyEvent.jhat.value;
-    SetHatActive(m_HatState != SDL_HAT_CENTERED);
-    CLog::Log(LOGDEBUG, "Joystick %d Hat %d Down with position %d", joyId, buttonId, m_HatState);
-    break;
-
-  case SDL_JOYBALLMOTION:
-    ignore = true;
-    break;
-    
-  case SDL_JOYBUTTONUP:
-    m_pressTicksButton = 0;
-    SetButtonActive(false);
-    CLog::Log(LOGDEBUG, "Joystick %d button %d Up", joyEvent.jbutton.which, m_ButtonId);
-
-  default:
-    ignore = true;
-    break;
-  }
+  //Stubbed out - never saw this called. Assuming it's used for event based detection. Why is that not the default?
+  //Seems that event based triggering would be more efficient than polling...?
 }
 
 bool CJoystick::GetHat(int &id, int &position,bool consider_repeat) 
 {
-  if (!IsHatActive())
-    return false;
-  position = m_HatState;
-  id = m_HatId;
-  if (!consider_repeat)
-    return true;
-
-  static uint32_t lastPressTicks = 0;
-  static uint32_t lastTicks = 0;
-  static uint32_t nowTicks = 0;
-
-  if ((m_HatId>=0) && m_pressTicksHat)
-  {
-    // return the id if it's the first press
-    if (lastPressTicks!=m_pressTicksHat)
-    {
-      lastPressTicks = m_pressTicksHat;
-      return true;
-    }
-    nowTicks = SDL_GetTicks();
-    if ((nowTicks-m_pressTicksHat)<500) // 500ms delay before we repeat
-      return false;
-    if ((nowTicks-lastTicks)<100) // 100ms delay before successive repeats
-      return false;
-
-    lastTicks = nowTicks;
-  }
-
-  return true;
+  //stubbed out
+  return false;
 } 
 
 bool CJoystick::GetButton(int &id, bool consider_repeat)
@@ -378,26 +268,57 @@
   axis = 0;
   maxAmount = 0;
   int tempf;
+  int tempval;
+
   for (int i = 1 ; i<=m_NumAxes ; i++)
   {
     tempf = abs(m_Amount[i]);
-    if (tempf>m_DeadzoneRange && tempf>maxAmount)
+    tempval = TriggerValue(m_Amount[i]);
+
+    //CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount - tempf = %d, non-abs value = %d,Axis = %d", tempf, tempval, i);
+
+    if ((i == 3 || i == 6) && tempval > 0) //TriggerValue accounts for init =0 case and then scales properly 
+    {
+      maxAmount = (tempval / 2); //divide by 2 as it won't handle > 32768
+      axis = i;
+      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_2 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], (maxAmount / 2));
+    }
+
+    if (tempf>m_DeadzoneRange && tempf>maxAmount && i != 3 && i != 6)
     {
       maxAmount = tempf;
       axis = i;
+      CLog::Log(LOGDEBUG, "GetAxisWithMaxAmount_3 - Axis: %d, Value = %d, maxAmount = %d", axis, m_Amount[i], maxAmount);
     }
   }
+  
+  CLog::Log(LOGDEBUG, "SetAxisActive? - %d", (0 != maxAmount));
   SetAxisActive(0 != maxAmount);
   return axis;
 }
 
 float CJoystick::GetAmount(int axis)
 {
-  if (m_Amount[axis] > m_DeadzoneRange)
-    return (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
-  if (m_Amount[axis] < -m_DeadzoneRange)
-    return (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
-  return 0;
+  CLog::Log(LOGDEBUG, "GetAmount - Axis %d, m_Amount = %d, MAX_AXIS = %d, m_Deadzone = %d", axis, m_Amount[axis], MAX_AXISAMOUNT, m_DeadzoneRange);
+  float fval = 0;
+
+  if ((axis == 3 || axis == 6) && TriggerValue(m_Amount[axis]) != 0) //ignore 0
+    fval = (float)(TriggerValue(m_Amount[axis]))/(float)(65535); //trigger is re-scaled to all positive
+  else if ((m_Amount[axis] > m_DeadzoneRange) && axis != 3 && axis != 6)
+    fval = (float)(m_Amount[axis]-m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
+  else if ((m_Amount[axis] < -m_DeadzoneRange) && axis != 3 && axis != 6)
+    fval = (float)(m_Amount[axis]+m_DeadzoneRange)/(float)(MAX_AXISAMOUNT-m_DeadzoneRange);
+
+  CLog::Log(LOGDEBUG, "GetAmount_2 - Axis %d, fval =  %f", axis, fval);
+  return fval;
+}
+
+int CJoystick::TriggerValue(int axisValue)
+{
+  if (is_used == true && axisValue  > -32268) //minimal deadzone (500) due to springs on the triggers
+    return (axisValue + 32768); //scale becomes 0 to 65535 because max positive = 32767
+  else
+    return 0;
 }
 
 float CJoystick::SetDeadzone(float val)
@@ -405,7 +326,9 @@
   if (val<0) val=0;
   if (val>1) val=1;
   m_DeadzoneRange = (int)(val*MAX_AXISAMOUNT);
+ 
+  CLog::Log(LOGDEBUG, "SetDeadzone value =  %f", val);
   return val;
 }
 
-#endif
+#endif
\ Kein Zeilenumbruch am Dateiende.
diff -Naur xbmc-pvr-c50f565/xbmc/input/SDLJoystick.h xbmc-pvr-c50f565.patch/xbmc/input/SDLJoystick.h
--- xbmc-pvr-c50f565/xbmc/input/SDLJoystick.h	2012-03-14 09:28:54.463565919 +0100
+++ xbmc-pvr-c50f565.patch/xbmc/input/SDLJoystick.h	2012-03-14 09:30:46.417005000 +0100
@@ -18,7 +18,8 @@
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */
-
+//Modified Nov 18, 2011 by Andrew Lockwood
+//Supports ONLY Xbox 360 Wireless controllers - maybe wired as well.
 #ifndef SDL_JOYSTICK_H
 #define SDL_JOYSTICK_H
 
@@ -43,7 +44,6 @@
 #define MAX_AXES 64
 #define MAX_AXISAMOUNT 32768
 
-
 // Class to manage all connected joysticks
 
 class CJoystick
@@ -72,6 +72,7 @@
   bool IsButtonActive() { return (m_ActiveFlags & JACTIVE_BUTTON) == JACTIVE_BUTTON; }
   bool IsAxisActive() { return (m_ActiveFlags & JACTIVE_AXIS) == JACTIVE_AXIS; }
   bool IsHatActive() { return (m_ActiveFlags & JACTIVE_HAT) == JACTIVE_HAT; }
+  int TriggerValue(int axisValue);
 
   int m_Amount[MAX_AXES];
   int m_AxisId;
@@ -86,10 +87,11 @@
   uint8_t m_ActiveFlags;
   std::vector<SDL_Joystick*> m_Joysticks;
   std::vector<std::string> m_JoystickNames;
+  bool is_used;
 };
 
 extern CJoystick g_Joystick;
 
 #endif
 
-#endif
+#endif
\ Kein Zeilenumbruch am Dateiende.

And here the xml-File "xbox360.xml":
<!-- This file is designed to work only with the Xbox 360 Wireless Controller -->
<!-- It will only work correctly with a modified SDLJoystick.cpp file that    -->
<!-- has fixes in it for the 360 triggers                                     -->

<keymap>
  <global>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Select</button> <!-- A -->
      <button id="2">Back</button> <!-- B -->
      <button id="3">Stop</button> <!-- X -->
      <button id="4">OSD</button> <!-- Y -->
      <button id="5">ContextMenu</button> <!-- LB -->
      <button id="6">Fullscreen</button> <!-- RB -->
      <button id="7">Back</button> <!-- Back -->
      <button id="8"></button> <!-- Start -->
      <button id="9">XBMC.ActivateWindow(Home)</button>  <!-- Xbox 360 Button -->
      <button id="10">EjectTray()</button> <!-- Left Tumbstick Click -->
      <button id="11">Screenshot</button> <!-- Right Thumbstick Click -->
      <button id="12">Left</button> <!-- Dpad Left -->
      <button id="13">Right</button> <!-- Dpad Right -->
      <button id="14">Up</button> <!-- Dpad Up -->
      <button id="15">Down</button> <!-- Dpad Down -->
      
      <axis limit="-1" id="1">Left</axis> <!-- Left stick, left -->
	  <axis limit="1" id="1">Right</axis> <!-- Left stick, right -->
	  <axis limit="-1" id="2">ScrollUp</axis> <!-- Left stick, up -->
	  <axis limit="1" id="2">ScrollDown</axis> <!-- Left stick, down -->
	  
	  <axis limit="-1" id="4">Left</axis> <!-- Right stick, left -->
	  <axis limit="1" id="4">Right</axis> <!-- Right stick, right -->
	  <axis limit="-1" id="5">VolumeUp</axis> <!-- Right stick, up -->
      <axis limit="1" id="5">VolumeDown</axis> <!-- Right stick, down -->
      	  
	  <axis limit="1" id="3">ScrollUp</axis> <!-- Left Trigger -->
	  <axis limit="1" id="6">ScrollDown</axis> <!-- Right Trigger -->
  </joystick>
  </global>
  <Home>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="3">XBMC.Skin.ToggleSetting(HomeViewToggle)</button> -->
    </joystick>
  </Home>
  <MyFiles>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="5">Highlight</button>
    </joystick>
  </MyFiles>
  <MyMusicPlaylist>
    <joystick name="Xbox 360 Wireless Receiver">
       <button id="3">Back</button>
      <!-- <button id="5">Delete</button> -->
    </joystick>
  </MyMusicPlaylist>
  <MyMusicFiles>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="3">FullScreen</button>
      <button id="5">ContextMenu</button>
    </joystick>
  </MyMusicFiles>
  <MyMusicLibrary>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="3">Playlist</button> -->
      <button id="5">ContextMenu</button>
    </joystick>
  </MyMusicLibrary>
  <FullscreenVideo>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Pause</button>
      <button id="2">Stop</button>
      <button id="3">CodecInfo</button>
      <button id="5">AspectRatio</button>
      <button id="6">Info</button>
      <button id="9">OSD</button>
      <button id="14">BigStepForward</button>
      <button id="13">StepForward</button>
      <button id="15">BigStepBack</button>
      <button id="12">StepBack</button>      
      <axis limit="1" id="3">AnalogRewind</axis>
      <axis limit="1" id="6">AnalogFastForward</axis>
    </joystick>
  </FullscreenVideo>
  <FullscreenInfo>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
    </joystick>
  </FullscreenInfo>
  <PlayerControls>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
    </joystick>
  </PlayerControls>
  <Visualisation>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">Pause</button>
      <button id="2">Stop</button>
      <button id="3">FullScreen</button>
	  <button id="4">CodecInfo</button>
      <button id="5">XBMC.ActivateWindow(VisualisationPresetList)</button>
      <button id="6">Info</button>
      <button id="4">XBMC.ActivateWindow(MusicOSD)</button>
      <button id="12">SkipPrevious</button>
	  <button id="13">SkipNext</button>
	  <button id="14">PreviousPreset</button>
	  <button id="15">NextPreset</button>
      <!-- <axis limit="1" id="3">AnalogRewind</axis> -->
      <!-- <axis limit="1" id="6">AnalogFastForward</axis> -->
    </joystick>
  </Visualisation>
  <MusicOSD>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
      <!-- <button id="3">CodecInfo</button> -->
      <!-- <button id="6">Info</button> -->
    </joystick>
  </MusicOSD>
  <VisualisationSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
      <!-- <button id="9">Back</button> -->
    </joystick>
  </VisualisationSettings>
  <VisualisationPresetList>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
      <!-- <button id="3">Back</button> -->
      <!-- <button id="9">Back</button> -->
    </joystick>
  </VisualisationPresetList>
  <SlideShow>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="1">Pause</button> -->
      <!-- <button id="2">Stop</button> -->
      <!-- <button id="10">CodecInfo</button> -->
      <!-- <button id="9">ZoomNormal</button> -->
      <!-- <button id="14">Rotate</button> -->
      <!-- <button id="4">Info</button> -->
      <!-- <button id="5">ZoomIn</button> -->
      <!-- <button id="13">NextPicture</button> -->
      <!-- <button id="6">ZoomOut</button> -->
      <!-- <button id="12">PreviousPicture</button> -->
    </joystick>
  </SlideShow>
  <ScreenCalibration>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">NextCalibration</button>
      <button id="3">ResetCalibration</button>
      <button id="4">NextResolution</button>
    </joystick>
  </ScreenCalibration>
  <GUICalibration>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="1">NextCalibration</button>
      <button id="3">ResetCalibration</button>
      <button id="4">NextResolution</button>
    </joystick>
  </GUICalibration>
  <VideoOSD>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="2">Back</button> -->
    </joystick>
  </VideoOSD>
  <VideoMenu>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="5">AspectRatio</button> -->
      <!-- <button id="2">Stop</button> -->
      <!-- <button id="9">OSD</button> -->
      <!-- <button id="4">Info</button> -->
      <!-- <button id="3">CodecInfo</button> -->
    </joystick>
  </VideoMenu>
  <OSDVideoSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="4"/> -->
      <!-- <button id="5">AspectRatio</button> -->
      <!-- <button id="19">Back</button> -->
    </joystick>
  </OSDVideoSettings>
  <OSDAudioSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="4"/> -->
      <!-- <button id="5">AspectRatio</button> -->
      <!-- <button id="7">Back</button> -->
    </joystick>
  </OSDAudioSettings>
  <VideoBookmarks>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="4"/> -->
      <!-- <button id="5">Delete</button> -->
      <!-- <button id="7">Back</button> -->
    </joystick>
  </VideoBookmarks>
  <MyVideoLibrary>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="3">Delete</button> -->
    </joystick>
  </MyVideoLibrary>
  <MyVideoFiles>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="5">Queue</button> -->
      <!-- <button id="3">Playlist</button> -->
    </joystick>
  </MyVideoFiles>
  <MyVideoPlaylist>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="5">Delete</button> -->
      <!-- <button id="7">Back</button> -->
    </joystick>
  </MyVideoPlaylist>
  <VirtualKeyboard>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="8">Enter</button>
      <button id="3">BackSpace</button>
      <button id="5">Shift</button>
      <button id="6">Symbols</button>
    </joystick>
  </VirtualKeyboard>
  <ContextMenu>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="7">Back</button> -->
    </joystick>
  </ContextMenu>
  <Scripts>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="4">XBMC.ActivateWindow(ScriptsDebugInfo)</button>
    </joystick>
  </Scripts>
  <NumericInput>
    <joystick name="Xbox 360 Wireless Receiver">
      <button id="3">BackSpace</button>
      <button id="8">Enter</button>
    </joystick>
  </NumericInput>
  <GamepadInput>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="9">Stop</button> -->
    </joystick>
  </GamepadInput>
  <LockSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="7">Back</button> -->
    </joystick>
  </LockSettings>
  <ProfileSettings>
    <joystick name="Xbox 360 Wireless Receiver">
      <!-- <button id="7">Back</button> -->
    </joystick>
  </ProfileSettings>
</keymap>
Last Edit: 4 years 10 months ago by de45dd.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2