Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ability to skip specific key/button map translations when running in standalone mode #1391

Closed
wants to merge 1 commit into from

3 participants

@mkortstiege
Collaborator

This commit disables the "ToggleFullScreen" mapping in standalone mode (only) without the need to hack the actual keymap files.

@t-nelson

Any thoughts on overriding this in the case debug is enabled from GUI settings?

@mkortstiege
Collaborator

No thoughts about it really. Mind explaining why it should be disabled in case of debug enabled?

@FernetMenta
Collaborator

Shouldn't ToggleFullScreen be better blocked in graphics context when running standalone?

@mkortstiege
Collaborator

@FernetMenta blocking is a really bad idea as some external players want fullscreen and suspend XBMC. Same applies to various launcher addons (emulator and the likes).

@FernetMenta
Collaborator

@vdrfan
We have just discussed this in the Linux forum. Running XBMC standalone needs special handling for X windows, setting the override redirect flag. Not doing so results in poor rendering performance. That means you can't launch other gui application when running XBMC standalone. For those cases you need a window manager.

@mkortstiege
Collaborator

@FernetMenta but running --standalone is possible with a window manager as well. Blocking the toggle would cause some serious issues for all the addons on XBMCbuntu and derivates i'd guess.

@FernetMenta
Collaborator

see #1175
It currently checks for standalone in order to determine if override redirect flag should be set. A different approach would be checking for a window manager: FernetMenta@b1369f4
Some users do weird things, e.g. launching a window manager in a script to bring up a browser. If no WM is present, no other gui applications should be launched nor XBMC minimized or windowed.

@mkortstiege
Collaborator

I'll leave that to you guys ,) I just want to avoid silly toggles that end up in a user nightmare.

@mkortstiege mkortstiege closed this
@tru tru referenced this pull request from a commit in plexinc/plex-home-theater-public
@tru tru Make PIN input secret
Closes #1391
d87da8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 8, 2012
  1. @mkortstiege
This page is out of date. Refresh to see the latest.
View
2  system/keymaps/joystick.Harmony.xml
@@ -114,7 +114,7 @@
<!-- Info --> <button id="31">XBMC.ActivateWindow(Settings)</button>
<!-- Exit --> <button id="51">XBMC.ActivateWindow(ShutdownMenu)</button>
<!-- #enter --> <button id="36">XBMC.ActivateWindow(SystemInfo)</button>
- <!-- 1 --> <button id="11">ToggleFullScreen</button>
+ <!-- 1 --> <button id="11" standalone="false">ToggleFullScreen</button>
</joystick>
</Home>
<MyFiles>
View
2  system/keymaps/keyboard.xml
@@ -91,7 +91,7 @@
<numpadseven>Number7</numpadseven>
<numpadeight>Number8</numpadeight>
<numpadnine>Number9</numpadnine>
- <backslash>ToggleFullScreen</backslash>
+ <backslash standalone="false">ToggleFullScreen</backslash>
<home>FirstPage</home>
<end>LastPage</end>
<!-- PVR windows -->
View
51 xbmc/input/ButtonTranslator.cpp
@@ -20,6 +20,7 @@
*/
#include "system.h"
+#include "Application.h"
#include "interfaces/Builtins.h"
#include "ButtonTranslator.h"
#include "utils/URIUtils.h"
@@ -945,6 +946,21 @@ void CButtonTranslator::MapAction(uint32_t buttonCode, const char *szAction, but
}
}
+bool CButtonTranslator::SkipTranslation(TiXmlElement *pButton)
+{
+ if (g_application.IsStandAlone())
+ {
+ // in case we're running in standalone mode,
+ // check whether the button should be translated.
+ bool bStandAlone = true;
+ pButton->QueryBoolAttribute("standalone", &bStandAlone);
+ if (!bStandAlone)
+ return true;
+ }
+
+ return false;
+}
+
bool CButtonTranslator::HasDeviceType(TiXmlNode *pWindow, CStdString type)
{
return pWindow->FirstChild(type) != NULL;
@@ -977,22 +993,25 @@ void CButtonTranslator::MapWindowActions(TiXmlNode *pWindow, int windowID)
while (pButton)
{
- uint32_t buttonCode=0;
- if (type == "gamepad")
- buttonCode = TranslateGamepadString(pButton->Value());
- else if (type == "remote")
- buttonCode = TranslateRemoteString(pButton->Value());
- else if (type == "universalremote")
- buttonCode = TranslateUniversalRemoteString(pButton->Value());
- else if (type == "keyboard")
- buttonCode = TranslateKeyboardButton(pButton);
- else if (type == "mouse")
- buttonCode = TranslateMouseCommand(pButton->Value());
- else if (type == "appcommand")
- buttonCode = TranslateAppCommand(pButton->Value());
-
- if (buttonCode && pButton->FirstChild())
- MapAction(buttonCode, pButton->FirstChild()->Value(), map);
+ if (!SkipTranslation(pButton))
+ {
+ uint32_t buttonCode=0;
+ if (type == "gamepad")
+ buttonCode = TranslateGamepadString(pButton->Value());
+ else if (type == "remote")
+ buttonCode = TranslateRemoteString(pButton->Value());
+ else if (type == "universalremote")
+ buttonCode = TranslateUniversalRemoteString(pButton->Value());
+ else if (type == "keyboard")
+ buttonCode = TranslateKeyboardButton(pButton);
+ else if (type == "mouse")
+ buttonCode = TranslateMouseCommand(pButton->Value());
+ else if (type == "appcommand")
+ buttonCode = TranslateAppCommand(pButton->Value());
+
+ if (buttonCode && pButton->FirstChild())
+ MapAction(buttonCode, pButton->FirstChild()->Value(), map);
+ }
pButton = pButton->NextSiblingElement();
}
View
2  xbmc/input/ButtonTranslator.h
@@ -121,6 +121,8 @@ class CButtonTranslator
void MapWindowActions(TiXmlNode *pWindow, int wWindowID);
void MapAction(uint32_t buttonCode, const char *szAction, buttonMap &map);
+ bool SkipTranslation(TiXmlElement *pButton);
+
bool LoadKeymap(const CStdString &keymapPath);
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
bool LoadLircMap(const CStdString &lircmapPath);
Something went wrong with that request. Please try again.