m_lastAxisMap[joystickName].erase(wKeyID);
}
- return ProcessJoystickEvent(joystickName, wKeyID, isAxis, fAmount);
+ return ProcessJoystickEvent(joystickName, wKeyID, isAxis ? JACTIVE_AXIS : JACTIVE_BUTTON, fAmount);
}
else
{
for (map<std::string, map<int, float> >::iterator iter = m_lastAxisMap.begin(); iter != m_lastAxisMap.end(); ++iter)
{
for (map<int, float>::iterator iterAxis = (*iter).second.begin(); iterAxis != (*iter).second.end(); ++iterAxis)
- ProcessJoystickEvent((*iter).first, (*iterAxis).first, true, (*iterAxis).second);
+ ProcessJoystickEvent((*iter).first, (*iterAxis).first, JACTIVE_AXIS, (*iterAxis).second);
}
}
return false;
}
-bool CApplication::ProcessJoystickEvent(const std::string& joystickName, int wKeyID, bool isAxis, float fAmount, unsigned int holdTime /*=0*/)
+bool CApplication::ProcessJoystickEvent(const std::string& joystickName, int wKeyID, short inputType, float fAmount, unsigned int holdTime /*=0*/)
{
#if defined(HAS_EVENT_SERVER)
m_idleTimer.StartZero();
bool fullRange = false;
// Translate using regular joystick translator.
- if (CButtonTranslator::GetInstance().TranslateJoystickString(iWin, joystickName.c_str(), wKeyID, isAxis ? JACTIVE_AXIS : JACTIVE_BUTTON, actionID, actionName, fullRange))
+ if (CButtonTranslator::GetInstance().TranslateJoystickString(iWin, joystickName.c_str(), wKeyID, inputType, actionID, actionName, fullRange))
return ExecuteInputAction( CAction(actionID, fAmount, 0.0f, actionName, holdTime) );
else
CLog::Log(LOGDEBUG, "ERROR mapping joystick action. Joystick: %s %i",joystickName.c_str(), wKeyID);
bool ProcessGamepad(float frameTime);
bool ProcessEventServer(float frameTime);
bool ProcessPeripherals(float frameTime);
- bool ProcessJoystickEvent(const std::string& joystickName, int button, bool isAxis, float fAmount, unsigned int holdTime = 0);
+ bool ProcessJoystickEvent(const std::string& joystickName, int button, short inputType, float fAmount, unsigned int holdTime = 0);
bool ExecuteInputAction(const CAction &action);
int GetActiveWindowID(void);
#include <list>
#include "WinEventsIOS.h"
#include "input/XBMC_vkeys.h"
+#include "input/SDLJoystick.h"
#include "Application.h"
#include "windowing/WindowingFactory.h"
#include "threads/CriticalSection.h"
// the jbutton.which will be the keyID to translate using joystick.AppleRemote.xml
// jbutton.holdTime is the time the button is hold in ms (for repeated keypresses)
std::string joystickName = "AppleRemote";
- bool isAxis = false;
float fAmount = 1.0;
unsigned char wKeyID = pumpEvent.jbutton.which;
unsigned int holdTime = pumpEvent.jbutton.holdTime;
CLog::Log(LOGDEBUG,"CWinEventsIOS: Button press keyID = %i", wKeyID);
- ret |= g_application.ProcessJoystickEvent(joystickName, wKeyID, isAxis, fAmount, holdTime);
+ ret |= g_application.ProcessJoystickEvent(joystickName, wKeyID, JACTIVE_BUTTON, fAmount, holdTime);
}
else
ret |= g_application.OnEvent(pumpEvent);