Skip to content
This repository
Browse code

fixed, ProcessJoystickEvent was broke for axis handling

  • Loading branch information...
commit 6c11ee3335e9b787d7e85638bbcebf05e2890d57 1 parent b781c57
authored

Showing 1 changed file with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. 10  xbmc/Application.cpp
10  xbmc/Application.cpp
@@ -3086,11 +3086,17 @@ bool CApplication::ProcessJoystickEvent(const std::string& joystickName, int wKe
3086 3086
    int iWin = GetActiveWindowID();
3087 3087
    int actionID;
3088 3088
    CStdString actionName;
3089  
-   bool fullRange = false;
  3089
+   bool fullrange;
3090 3090
 
  3091
+   if (isAxis && fAmount < 0.0)
  3092
+     wKeyID = -wKeyID;
3091 3093
    // Translate using regular joystick translator.
3092  
-   if (CButtonTranslator::GetInstance().TranslateJoystickString(iWin, joystickName.c_str(), wKeyID, isAxis ? JACTIVE_AXIS : JACTIVE_BUTTON, actionID, actionName, fullRange))
  3094
+   if (CButtonTranslator::GetInstance().TranslateJoystickString(iWin, joystickName.c_str(), wKeyID, isAxis ? JACTIVE_AXIS : JACTIVE_BUTTON, actionID, actionName, fullrange))
  3095
+   {
  3096
+     if (isAxis)
  3097
+       fAmount = fullrange ? (fAmount + 1.0f)/2.0f : fabs(fAmount);
3093 3098
      return ExecuteInputAction( CAction(actionID, fAmount, 0.0f, actionName, holdTime) );
  3099
+   }
3094 3100
    else
3095 3101
      CLog::Log(LOGDEBUG, "ERROR mapping joystick action. Joystick: %s %i",joystickName.c_str(), wKeyID);
3096 3102
 #endif

0 notes on commit 6c11ee3

Please sign in to comment.
Something went wrong with that request. Please try again.