<key id="KEY_BLUE" mapto="extensions" flags="b" />
</map>
+ <map context="SatlistShortcutAction">
+ <key id="KEY_BLUE" mapto="nothingconnected" flags="b" />
+ </map>
+
<map context="InfobarChannelSelection">
<key id="KEY_LEFT" mapto="zapUp" flags="mr" />
<key id="KEY_RIGHT" mapto="zapDown" flags="mr" />
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCShortDriver::keyPressed);
- eRCInput::getInstance()->setFile(handle);
}
}
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCInputEventDriver::keyPressed);
- eRCInput::getInstance()->setFile(handle);
}
}
return name;
}
+void eRCInputEventDriver::setExclusive(bool b)
+{
+ if (handle >= 0)
+ {
+ int grab = b;
+ if (::ioctl(handle, EVIOCGRAB, grab) < 0)
+ perror("EVIOCGRAB");
+ }
+}
+
eRCInputEventDriver::~eRCInputEventDriver()
{
if (handle>=0)
{
ASSERT( !instance);
instance=this;
- handle = -1;
locked = 0;
keyboardMode = kmNone;
}
return false;
}
-int eRCInput::lock()
+void eRCInput::lock()
{
locked=1;
- return handle;
+ for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
+ i->second->setExclusive(false);
}
void eRCInput::unlock()
{
- if (locked)
- locked=0;
-}
-
-void eRCInput::setFile(int newh)
-{
- handle=newh;
+ locked=0;
+ for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
+ i->second->setExclusive(true);
}
void eRCInput::addDevice(const std::string &id, eRCDevice *dev)
if (i == devices.end())
{
eDebug("failed, possible choices are:");
- for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
+ for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
eDebug("%s", i->first.c_str());
return 0;
}
* \param key The key to get the description for.
* \result User readable description of given key.
*/
+ virtual void setExclusive(bool b) { };
};
/**
~eRCDriver();
void enable(int en) { enabled=en; }
+ virtual void setExclusive(bool) { }
};
class eRCShortDriver: public eRCDriver
std::string getDeviceName();
eRCInputEventDriver(const char *filename);
~eRCInputEventDriver();
+ void setExclusive(bool b); // in exclusive mode data is not carried to console device
};
class eRCKey
class eRCInput: public Object
{
int locked;
- int handle;
static eRCInput *instance;
int keyboardMode;
#ifdef SWIG
void close();
bool open();
- void setFile(int handle);
-
/* This is only relevant for "keyboard"-styled input devices,
i.e. not plain remote controls. It's up to the input device
driver to decide wheter an input device is a keyboard or
void setKeyboardMode(int mode) { keyboardMode = mode; }
int getKeyboardMode() { return keyboardMode; }
static eRCInput *getInstance() { return instance; }
- int lock();
+ void lock();
void unlock();
int islocked() { return locked; }
};
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCConsoleDriver::keyPressed);
- eRCInput::getInstance()->setFile(handle);
}
/* set console mode */
break;
}
}
+ setExclusive(true);
eDebug("Input device \"%s\" is %sa keyboard.", id.c_str(), iskeyboard ? "" : "not ");
+}
+void eRCDeviceInputDev::setExclusive(bool b)
+{
+ driver->setExclusive(!iskeyboard && b);
}
const char *eRCDeviceInputDev::getDescription() const
void handleCode(long code);
eRCDeviceInputDev(eRCInputEventDriver *driver);
const char *getDescription() const;
+ void setExclusive(bool);
};
#endif
from Components.ConfigList import ConfigListScreen
from Components.MenuList import MenuList
from Components.NimManager import nimmanager
-from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection, updateConfigElement
+from Components.config import getConfigListEntry, config, ConfigNothing, ConfigSelection, updateConfigElement,\
+ ConfigSatlist
from Components.Sources.List import List
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
ConfigListScreen.__init__(self, self.list)
- self["actions"] = ActionMap(["SetupActions"],
+ self["actions"] = ActionMap(["SetupActions", "SatlistShortcutAction"],
{
"ok": self.keySave,
"cancel": self.keyCancel,
+ "nothingconnected": self.nothingConnectedShortcut
}, -2)
self.slotid = slotid
# we need to call saveAll to reset the connectedTo choices
self.saveAll()
self.close()
+
+ def nothingConnectedShortcut(self):
+ if type(self["config"].getCurrent()[1]) is ConfigSatlist:
+ self["config"].getCurrent()[1].setValue("3601")
+ self["config"].invalidateCurrent()
class NimSelection(Screen):
def __init__(self, session):