Update evdevDriver.py

This commit is contained in:
chrys87 2018-05-18 11:49:43 +02:00 committed by GitHub
parent 6a10d7b50c
commit 0ee55d1ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,22 +142,29 @@ class driver(inputDriver):
uDevice.write_event(event)
uDevice.syn()
def updateInputDevices(self, force = False, init = False):
def updateInputDevices(self, newDevices = None, init = False):
if init:
self.removeAllDevices()
deviceFileList = evdev.list_devices()
if not force and False:
print(newDevices)
if newDevices and not init:
deviceFileList = newDevices
else:
deviceFileList = evdev.list_devices()
if len(deviceFileList) == self.iDeviceNo:
return
return
mode = self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper()
iDevicesFiles = []
for device in self.iDevices:
iDevicesFiles.append(self.iDevices[device].fn)
if len(iDevicesFiles) == len(deviceFileList):
return
eventType = evdev.events
for deviceFile in deviceFileList:
try:
if not deviceFile:
continue
if deviceFile == '':
continue
if deviceFile in iDevicesFiles:
continue
try: