Ticket #10747 (closed Patches: Obsolete)

Opened 4 years ago

Last modified 22 months ago

Joystick still send event to xbm when using emulator through launcher plugin

Reported by: mat0738 Owned by:
Priority: 4 - Normal Milestone:
Component: Keymapping (Remote Control / Gamepad Controller) Version: GIT
Severity: Normal Keywords: joystick, controller, keymap, program, launcher
Cc: Blocked By:
Blocking: Platform: All
Revision:

Description

I configured a joystick(psx controller) to navigate into xbmc. when i launch an emulator (pcsx/gens) or an application (fofix), xbmc still respond to controller input. (eg: launching another instance of the emulator, etc.)

I didn't find a FullscreenProgram section for keymap.xml which would then allow me to disable some keys.

I don't know if the best solution is:

  • add a FullscreenProgram
  • tell xbmc to stop reading input from joystick when xbm window is not focused

an advantage of the FullscreenProgram would if we could map a combination of key (eg: l1+r1+l2+r2+select+start) to exit the current program but I guess it's not easy and maybe not desirable.

Attachments

joystick.diff Download (433 bytes) - added by spiff 4 years ago.
untested
disable_controller_if_focus_lost.diff Download (1.8 KB) - added by Obijywk 4 years ago.
Creates an AdvancedSetting for toggling the controller disable behavior when focus is lost
read_controller_if_not_focused.diff Download (1.8 KB) - added by Obijywk 4 years ago.
Adds a setting to enable responding to controller events when XBMC is not focused. Defaults to false.

Change History

Changed 4 years ago by spiff

untested

comment:1 Changed 4 years ago by spiff

attaching an untested diff to stop the reading. the other solution is way too involved. can you test?

comment:2 Changed 4 years ago by spiff

  • Status changed from new to closed
  • Resolution set to Fixed in SVN
  • Milestone changed from Future / Pending to 10.0

comment:3 Changed 4 years ago by mat0738

  • Status changed from closed to reopened
  • Resolution Fixed in SVN deleted

well, I just tested it and I still don't have the correct behavior. i tried to do some investigation:

bool CApplication::ProcessGamepad(float frameTime)
{
CLog::Log(LOGDEBUG, "Capplication::ProcessGamepad %i %i\n", m_AppFocused, m_AppActive);
#ifdef HAS_SDL_JOYSTICK
  if (!m_AppFocused) {
    return false;
  }

with this debug line I can see that m_AppFocused and m_AppActive are still true

tail -f ~/.xbmc/temp/xbmc.log

00:20:15 T:3018454832 M:242503680 ERROR: Capplication::ProcessGamepad 1 1

00:20:15 T:3018454832 M:242503680 ERROR: Keymapping error: no such action defined

00:20:15 T:3018454832 M:242503680 ERROR: Capplication::ProcessGamepad 1 1

00:20:15 T:3018454832 M:242503680 ERROR: Keymapping error: no such action defined

00:20:15 T:3018454832 M:242503680 ERROR: Capplication::ProcessGamepad 1 1

this might be related to my setup, I'm just running xbmc in an empty X server

echo exec xbmc > .xinitrc
startx

so there is no window manager that could tell xbmc focused has changed

comment:4 Changed 4 years ago by mat0738

oh and I can do more testing if you want more informations. just tell me where to look/what to look for

comment:5 Changed 4 years ago by Benke01

I have installed XBMC Dharma RC2 and this bug fix seems to have be implemented after RC1. Personally I see this bug as a feature. Having XBMC running in fullscreen on my TV (secondary computer display) my computer can still be used while my gamepad still operates XBMC which is very convenient. Could it be possible to add this as a configuration in some way (in XBMC or in the gamepad configurations for example)?

comment:6 Changed 4 years ago by Obijywk

I'd like to second this request to toggle this behavior with a setting. I would even be willing to try implementing the change if someone would give me a pointer to where you think the setting should live (would advancedsettings.xml be appropriate?). Thanks.

Changed 4 years ago by Obijywk

Creates an AdvancedSetting for toggling the controller disable behavior when focus is lost

comment:7 Changed 4 years ago by spiff

please reverse the setting, i dislike disable settings when they can be avoided. make it a keep listening to input setting and default it to false. more logical to 'enable' something, as current behaviour would be the default in most apps.

Changed 4 years ago by Obijywk

Adds a setting to enable responding to controller events when XBMC is not focused. Defaults to false.

comment:8 Changed 4 years ago by Obijywk

Is the new patch acceptable? Does anything else need to be done before it is submitted? Thanks.

comment:9 Changed 3 years ago by jmarshall

What is the settings useful for? It appears to be for the case where m_AppFocused is true but you still want to ignore the gamepad.

Why is m_AppFocused true if the app isn't focused?

comment:10 Changed 3 years ago by Obijywk

It's the other way around - this setting is for when m_AppFocused is false but you do NOT want to ignore the gamepad. This is useful in a dual monitor setup, if you want to using the mouse/keyboard in a web browser on one monitor and still use your gamepad to control XBMC on the other monitor.

comment:11 Changed 3 years ago by jmarshall

Right so this isn't actually addressing the OP's problem, but rather a related issue?

Instead, this is of use to those who:

  1. Have dual monitors.
  2. Have a gamepad to control XBMC with.
  3. Want to have XBMC sitting there "in the background" on a separate monitor.

Perhaps it should apply to a remote as well?

comment:12 Changed 3 years ago by Obijywk

Yep, that's the exact situation where this option is useful. I need this feature for my setup and it looks like Benke01 who posted above needs it as well.

As far as I can tell, ProcessRemote does not have a similar check to see if m_AppFocused is set. The m_AppFocused check was added only to ProcessGamepad by spiff's patch above (joystick.diff). So I suspect the IR remote will still work even if XBMC doesn't have focus, but I don't have an IR remote to test this with.

comment:13 Changed 3 years ago by Benke01

Yes, I'm still following the issue since 8 weeks back. :) The change is to by configuration being able to revert back XBMC's previous behaviour (Dharma RC1 and earlier). Thanks Obijywk for your work, btw! :)

comment:14 Changed 3 years ago by sho

  • Component changed from Other (un-categorized) to Keymapping (Remote Control / Gamepad Controller)

comment:15 Changed 3 years ago by sho

  • Type changed from Bugs to Patches

comment:16 Changed 3 years ago by vdrfan

  • Milestone changed from 11.0 to Future / Pending

comment:17 Changed 2 years ago by sho

  • Summary changed from jostick still send event to xbm when using emulator trough launcher plugin to Joystick still send event to xbm when using emulator through launcher plugin

comment:18 Changed 22 months ago by Martijn

  • Status changed from reopened to closed
  • Resolution set to Obsolete
  • Milestone Future / Pending deleted

patches are now only handled at  https://github.com/xbmc/xbmc in case this is still needed / valid against latest XBMC master create a patch PR for review

Note: See TracTickets for help on using tickets.