From: ghost Date: Sat, 13 Feb 2010 17:47:15 +0000 (+0100) Subject: lib/driver/rc.cpp,rcinput.cpp: only do EVIOCGRAB when event bit 0x1E is set in event... X-Git-Tag: 3.0.0~28^2~66^2~63 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/49d3b0f03998616458f86c340b4bbb39f0ab4c4e?hp=4731ddecbf9d91941d9e4f0f43bf4504241596fb lib/driver/rc.cpp,rcinput.cpp: only do EVIOCGRAB when event bit 0x1E is set in event device evbits --- diff --git a/lib/driver/rc.cpp b/lib/driver/rc.cpp index c56fde44..c1ff13ea 100644 --- a/lib/driver/rc.cpp +++ b/lib/driver/rc.cpp @@ -129,8 +129,11 @@ void eRCInputEventDriver::setExclusive(bool b) { if (handle >= 0) { + long evbits; int grab = b; - if (::ioctl(handle, EVIOCGRAB, grab) < 0) + if (::ioctl(handle, EVIOCGBIT(0, EV_MAX+1), &evbits) < 0) + perror("EVIOCGBIT"); + else if ((evbits & (1 << 0x1E)) && ::ioctl(handle, EVIOCGRAB, grab) < 0) perror("EVIOCGRAB"); } } diff --git a/lib/driver/rcinput.cpp b/lib/driver/rcinput.cpp index e593087d..2bfeefa1 100644 --- a/lib/driver/rcinput.cpp +++ b/lib/driver/rcinput.cpp @@ -89,7 +89,8 @@ eRCDeviceInputDev::eRCDeviceInputDev(eRCInputEventDriver *driver) void eRCDeviceInputDev::setExclusive(bool b) { - driver->setExclusive(!iskeyboard && b); + if (!iskeyboard) + driver->setExclusive(b); } const char *eRCDeviceInputDev::getDescription() const