X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/a37ddbb7785de5f1d944f4937a5b2914ce6a3862..1fc2700e351c0297089925aba6c3a7b890dfb077:/lib/driver/rc.cpp 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"); } }