Merge branch 'bug_538_ignore_global_actions_in_standby'
[enigma2.git] / lib / driver / rcinput.cpp
index 107b337..f30ba8c 100644 (file)
@@ -11,7 +11,7 @@
 #include <lib/base/init_num.h>
 #include <lib/driver/input_fake.h>
 
-void eRCDeviceInputDev::handleCode(int rccode)
+void eRCDeviceInputDev::handleCode(long rccode)
 {
        struct input_event *ev = (struct input_event *)rccode;
        if (ev->type!=EV_KEY)
@@ -73,18 +73,16 @@ void eRCDeviceInputDev::handleCode(int rccode)
 eRCDeviceInputDev::eRCDeviceInputDev(eRCInputEventDriver *driver)
        :eRCDevice(driver->getDeviceName(), driver), iskeyboard(false)
 {
-       int len=id.length();
-       int idx=0;
-       while(idx <= len-8)
-       {
-               if (!strncasecmp(&id[idx++], "KEYBOARD", 8))
-               {
-                       iskeyboard=true;
-                       break;
-               }
-       }
+       if (strcasestr(id.c_str(), "keyboard") != NULL)
+               iskeyboard = true;
+       setExclusive(true);
        eDebug("Input device \"%s\" is %sa keyboard.", id.c_str(), iskeyboard ? "" : "not ");
+}
 
+void eRCDeviceInputDev::setExclusive(bool b)
+{
+       if (!iskeyboard)
+               driver->setExclusive(b);
 }
 
 const char *eRCDeviceInputDev::getDescription() const