aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/driver/rc.cpp10
-rw-r--r--lib/driver/rc.h1
-rw-r--r--lib/driver/rcinput.cpp1
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/driver/rc.cpp b/lib/driver/rc.cpp
index c7acd113..8dab0201 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 9708ea7b..ef0588c4 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 d10d94f3..0aada8df 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 ");
}