Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add new GUI setting for Joystick and use that setting

  • Loading branch information...
commit bd9b6c6b8739b1729b6adb74737cfe4906274b54 1 parent 3a10025
Karlson2k authored
8 language/English/strings.po
View
@@ -9294,7 +9294,13 @@ msgctxt "#35009"
msgid "Do not use the custom keymap for this device"
msgstr ""
-#empty strings from id 35010 to 35499
+#empty strings from id 35010 to 35099
+
+msgctxt "#35100"
+msgid "Enable joystick and gamepad support"
+msgstr ""
+
+#empty strings from id 35101 to 35499
msgctxt "#35500"
msgid "Location"
2  xbmc/Application.cpp
View
@@ -1351,7 +1351,7 @@ bool CApplication::Initialize()
ResetScreenSaver();
#ifdef HAS_SDL_JOYSTICK
- g_Joystick.Initialize();
+ g_Joystick.SetEnabled(g_guiSettings.GetBool("input.enablejoystick"));
#endif
return true;
3  xbmc/settings/GUISettings.cpp
View
@@ -520,6 +520,9 @@ void CGUISettings::Initialize()
#else
AddBool(in, "input.enablemouse", 21369, true);
#endif
+#if defined(HAS_SDL_JOYSTICK)
+ AddBool(in, "input.enablejoystick", 35100, true);
+#endif
CSettingsCategory* net = AddCategory(4, "network", 798);
if (g_application.IsStandAlone())
11 xbmc/settings/GUIWindowSettingsCategory.cpp
View
@@ -92,6 +92,11 @@
#include "Settings.h"
#include "AdvancedSettings.h"
#include "input/MouseStat.h"
+#if defined(TARGET_WINDOWS)
+#include "input/windows/WINJoystick.h"
+#elif defined(HAS_SDL_JOYSTICK)
+#include "input/SDLJoystick.h"
+#endif
#include "guilib/LocalizeStrings.h"
#include "LangInfo.h"
#include "utils/StringUtils.h"
@@ -1388,6 +1393,12 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
{
g_Mouse.SetEnabled(g_guiSettings.GetBool("input.enablemouse"));
}
+ else if (strSetting.Equals("input.enablejoystick"))
+ {
+#if defined(HAS_SDL_JOYSTICK)
+ g_Joystick.SetEnabled(g_guiSettings.GetBool("input.enablejoystick"));
+#endif
+ }
else if (strSetting.Equals("videoscreen.screen"))
{
DisplayMode mode = g_guiSettings.GetInt("videoscreen.screen");
Please sign in to comment.
Something went wrong with that request. Please try again.