From: ghost Date: Tue, 22 Dec 2009 14:33:20 +0000 (+0100) Subject: lib/driver/rc*: open remote control input devices in exclussive mode... so the keycod... X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=e8eb8e9694379204f4b9143ca6b33db48809df7f lib/driver/rc*: open remote control input devices in exclussive mode... so the keycodes are not supplied to the linux console --- diff --git a/lib/driver/rc.cpp b/lib/driver/rc.cpp index c7acd11..8dab020 100644 --- a/lib/driver/rc.cpp +++ b/lib/driver/rc.cpp @@ -127,6 +127,16 @@ std::string eRCInputEventDriver::getDeviceName() 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) diff --git a/lib/driver/rc.h b/lib/driver/rc.h index 9708ea7..ef0588c 100644 --- a/lib/driver/rc.h +++ b/lib/driver/rc.h @@ -112,6 +112,7 @@ public: std::string getDeviceName(); eRCInputEventDriver(const char *filename); ~eRCInputEventDriver(); + void setExclusive(bool b); // in exclusive mode data is not carried to console device }; class eRCKey diff --git a/lib/driver/rcinput.cpp b/lib/driver/rcinput.cpp index d10d94f..0aada8d 100644 --- a/lib/driver/rcinput.cpp +++ b/lib/driver/rcinput.cpp @@ -83,6 +83,7 @@ eRCDeviceInputDev::eRCDeviceInputDev(eRCInputEventDriver *driver) break; } } + driver->setExclusive(!iskeyboard); eDebug("Input device \"%s\" is %sa keyboard.", id.c_str(), iskeyboard ? "" : "not "); }