Update evdevDriver.py

This commit is contained in:
chrys87 2018-05-18 13:54:08 +02:00 committed by GitHub
parent efbaa0078a
commit 27c5075b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,13 +147,19 @@ class driver(inputDriver):
self.removeAllDevices() self.removeAllDevices()
print(newDevices) print(newDevices)
deviceFileList = None
if newDevices and not init: if newDevices and not init:
deviceFileList = newDevices deviceFileList = newDevices
else: else:
deviceFileList = evdev.list_devices() deviceFileList = evdev.list_devices()
if len(deviceFileList) == self.iDeviceNo: if len(deviceFileList) == self.iDeviceNo:
return return
if not deviceFileList:
return
mode = self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper() mode = self.env['runtime']['settingsManager'].getSetting('keyboard', 'device').upper()
iDevicesFiles = [] iDevicesFiles = []
for device in self.iDevices: for device in self.iDevices:
iDevicesFiles.append(self.iDevices[device].fn) iDevicesFiles.append(self.iDevices[device].fn)