Support turbo2.
[vuplus_dvbapp] / lib / python / Components / InputDevice.py
index d675ca3..6fe81ef 100755 (executable)
@@ -8,8 +8,8 @@ from os import path as os_path, listdir, open as os_open, close as os_close, wri
 # asm-generic/ioctl.h
 IOC_NRBITS = 8L
 IOC_TYPEBITS = 8L
-IOC_SIZEBITS = 13L
-IOC_DIRBITS = 3L
+IOC_SIZEBITS = 14L
+IOC_DIRBITS = 2L
 
 IOC_NRSHIFT = 0L
 IOC_TYPESHIFT = IOC_NRSHIFT+IOC_NRBITS
@@ -33,6 +33,9 @@ class inputDevices:
                devices = listdir("/dev/input/")
 
                for evdev in devices:
+                       if not evdev.startswith("event"):
+                               continue
+
                        try:
                                buffer = "\0"*512
                                self.fd = os_open("/dev/input/" + evdev, O_RDWR | O_NONBLOCK)
@@ -46,9 +49,9 @@ class inputDevices:
                        if self.name:
                                if self.name == 'dreambox front panel':
                                        continue
-                               if self.name == "dreambox advanced remote control (native)" and config.misc.rcused.value != 0:
+                               if self.name == "dreambox advanced remote control (native)" and config.misc.rcused.value == 1:
                                        continue
-                               if self.name == "dreambox remote control (native)" and config.misc.rcused.value == 0:
+                               if self.name == "dreambox remote control (native)" and config.misc.rcused.value != 1:
                                        continue
                                self.Devices[evdev] = {'name': self.name, 'type': self.getInputDeviceType(self.name),'enabled': False, 'configuredName': None }
        
@@ -74,7 +77,7 @@ class inputDevices:
                return sorted(self.Devices.iterkeys())
 
        def getDefaultRCdeviceName(self):
-               if config.misc.rcused.value == 0:
+               if config.misc.rcused.value != 1:
                        for device in self.Devices.iterkeys():
                                if self.Devices[device]["name"] == "dreambox advanced remote control (native)":
                                        return device