improve device detection
This commit is contained in:
		| @@ -52,6 +52,7 @@ class driver(inputDriver): | ||||
|             global _evdevAvailableError | ||||
|             self.env['runtime']['debug'].writeDebugOut('InputDriver: ' + _evdevAvailableError,debug.debugLevel.ERROR)          | ||||
|             return   | ||||
|         self.updateInputDevices() | ||||
|         if _udevAvailable: | ||||
|             self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev)         | ||||
|         else: | ||||
| @@ -61,14 +62,12 @@ class driver(inputDriver): | ||||
|         context = pyudev.Context() | ||||
|         monitor = pyudev.Monitor.from_netlink(context) | ||||
|         monitor.filter_by(subsystem='input') | ||||
|         # wait until start process finished | ||||
|         time.sleep(8)  | ||||
|         monitor.start() | ||||
|         while active.value: | ||||
|             devices = monitor.poll(2) | ||||
|             if devices: | ||||
|                 while monitor.poll(0.2): | ||||
|                     time.sleep(0.1) | ||||
|                     time.sleep(0.2) | ||||
|                 eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) | ||||
|         return time.time()         | ||||
|     def plugInputDeviceWatchdogTimer(self, active): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user