Permalink
Browse files

X11: add SDL joystick until we have a better solution

  • Loading branch information...
1 parent d33967f commit 9aef2c8651e9eb6f24bdde8df2cd4883e40d92db @FernetMenta FernetMenta committed with May 20, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 xbmc/windowing/WinEventsX11.cpp
@@ -35,6 +35,10 @@
#include "guilib/GUIWindowManager.h"
#include "input/MouseStat.h"
+#ifdef HAS_SDL_JOYSTICK
+#include "input/SDLJoystick.h"
+#endif
+
CWinEventsX11* CWinEventsX11::WinEvents = 0;
static const uint32_t SymMappingsX11[][2] =
@@ -515,6 +519,28 @@ bool CWinEventsX11::MessagePump()
ret |= ProcessKeyRepeat();
+#ifdef HAS_SDL_JOYSTICK
+ SDL_Event event;
+ while (SDL_PollEvent(&event))
+ {
+ switch(event.type)
+ {
+ case SDL_JOYBUTTONUP:
+ case SDL_JOYBUTTONDOWN:
+ case SDL_JOYAXISMOTION:
+ case SDL_JOYBALLMOTION:
+ case SDL_JOYHATMOTION:
+ g_Joystick.Update(event);
+ ret = true;
+ break;
+
+ default:
+ break;
+ }
+ memset(&event, 0, sizeof(SDL_Event));
+ }
+#endif
+
return ret;
}

0 comments on commit 9aef2c8

Please sign in to comment.