switch to non exclusive access on input devices when call eRCInput::lock (i.e. this fixes no more working Tuxtxt plugin)
remove some incorrect code eRCInput::lock now no more returns a device handle .. this is not possible this way..
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCShortDriver::keyPressed);
{
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);
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCInputEventDriver::keyPressed);
- eRCInput::getInstance()->setFile(handle);
if (handle >= 0)
{
int grab = b;
if (handle >= 0)
{
int grab = b;
- if (::ioctl(handle, EVIOCGRAB, &grab) < 0)
+ if (::ioctl(handle, EVIOCGRAB, grab) < 0)
{
ASSERT( !instance);
instance=this;
{
ASSERT( !instance);
instance=this;
locked = 0;
keyboardMode = kmNone;
}
locked = 0;
keyboardMode = kmNone;
}
+ for (std::map<std::string,eRCDevice*>::iterator i=devices.begin(); i != devices.end(); ++i)
+ i->second->setExclusive(false);
}
void eRCInput::unlock()
{
}
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)
}
void eRCInput::addDevice(const std::string &id, eRCDevice *dev)
if (i == devices.end())
{
eDebug("failed, possible choices are:");
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;
}
eDebug("%s", i->first.c_str());
return 0;
}
* \param key The key to get the description for.
* \result User readable description of given key.
*/
* \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; }
~eRCDriver();
void enable(int en) { enabled=en; }
+ virtual void setExclusive(bool) { }
};
class eRCShortDriver: public eRCDriver
};
class eRCShortDriver: public eRCDriver
class eRCInput: public Object
{
int locked;
class eRCInput: public Object
{
int locked;
static eRCInput *instance;
int keyboardMode;
#ifdef SWIG
static eRCInput *instance;
int keyboardMode;
#ifdef SWIG
void close();
bool open();
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
/* 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; }
void setKeyboardMode(int mode) { keyboardMode = mode; }
int getKeyboardMode() { return keyboardMode; }
static eRCInput *getInstance() { return instance; }
void unlock();
int islocked() { return locked; }
};
void unlock();
int islocked() { return locked; }
};
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCConsoleDriver::keyPressed);
{
sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCConsoleDriver::keyPressed);
- eRCInput::getInstance()->setFile(handle);
- driver->setExclusive(!iskeyboard);
eDebug("Input device \"%s\" is %sa keyboard.", id.c_str(), iskeyboard ? "" : "not ");
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
}
const char *eRCDeviceInputDev::getDescription() const
void handleCode(long code);
eRCDeviceInputDev(eRCInputEventDriver *driver);
const char *getDescription() const;
void handleCode(long code);
eRCDeviceInputDev(eRCInputEventDriver *driver);
const char *getDescription() const;
+ void setExclusive(bool);