Kodi Community Forum

Full Version: XBMC 13 still receives gamepad input even when it doesn't have focus
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been rebuilding my HTPC recently in order to accommodate emulators, and I've hit on an inconvenience.

I've got a wired xbox360 controller hooked up, and it works fine in xbmc. It also works fine when I launch, say, mednafen via Advanced Launcher.

The problem is, even though xbmc is minimized, it keeps responding to gamepad input. This means, while I'm playing an emulator, it's only a matter of time before I play a movie, reboot the box, reconfigure something, etc.

Is there a way to prevent this besides disabling joystick/gamepad support? Alternatively, is there a way to toggle joystick/gamepad support from the command line so I could disable it before launching the emu and then turn it back on when it exits? I have looked at the JSON doc, but don't see anything relevant.
I have a patch for it. As far as I know, this is the only way to get what you desire. This has worked for me since before 12.0. Only reason I can think of for this not being the desired behavior is perhaps using xbmc/kodi as a music player and wanting the remote to work while using other applications.

diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index e91b82b..97cc9c0 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -3038,6 +3038,8 @@ bool CApplication:TonguerocessGamepad(float frameTime)
bool CApplication:TonguerocessRemote(float frameTime)
{
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
+ if (!m_AppFocused)
+ return false;
if (g_RemoteControl.GetButton())
{
CKey key(g_RemoteControl.GetButton(), g_RemoteControl.GetHoldTime());
Thanks, sword.

I don't think I want to deal with patching at this point. I will leave joystick/gamepad support disabled for now if this can't be done with a command-line toggle.
It can be enabled/disabled via cli, see

http://forum.kodi.tv/showthread.php?tid=...pid1722549

But because of things like this, I prefer to close xbmc before running a emulator and restarting it afterwards.
Those curl commands should be exactly what I need!

I had tried shutting down xbmc to launch the emulators, but I had issues with it suddenly restarting while I was still playing.

I've just rebuilt with kodibuntu 14 this afternoon, so maybe I'll have better luck.
I havent used kodibuntu, but if its anything like xbmcbuntu, kodi will auto restart when killled in the kodi session of kodibuntu
(2015-01-02, 00:15)teeedubb Wrote: [ -> ]I havent used kodibuntu, but if its anything like xbmcbuntu, kodi will auto restart when killled in the kodi session of kodibuntu

Kodibuntu is XBMCbuntu, just renamed along with the app.

Thing is, I wasn't having that problem on Kodi/XBMCbuntu. I was running XBMC 13 on a full Ubuntu 14.10 install.

Now that I've reinstalled with Kodibuntu 14, I've got plenty of other issues. I think I'll be going back to ordinary Ubuntu shortly.
Hello everyone,

I have a problem with the jsonrpc approach. Namely that if I turn off gamepad support in Kodi, then run my application, and then turn it back on, the gamepad won't work until I restart Kodi.

This seems to be a general Kodi thing, and not related to the jsonrpc, since it is the same behavior if I change the settings in Kodi-Settings.
When I disable the gamepad in Kodi, and then re-enable it, the gamepad only works after I restart Kodi.

Is there any way to have it work immediately after I enable it?