X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdriver%2Frcinput.cpp;h=f30ba8cbe7f85010d76d8f25df36f276988181fd;hp=9662fd23fe04e263380cb9de88151ea3435b6040;hb=7199d3c37e7e7065bd6943702b5864fa5186b9a8;hpb=e77fe4f47dc53fc7581746ec3670d38425e75439 diff --git a/lib/driver/rcinput.cpp b/lib/driver/rcinput.cpp index 9662fd2..f30ba8c 100644 --- a/lib/driver/rcinput.cpp +++ b/lib/driver/rcinput.cpp @@ -11,7 +11,7 @@ #include #include -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) - { - 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