Update evdevDriver.py

This commit is contained in:
chrys87 2018-05-14 14:13:29 +02:00 committed by GitHub
parent 30372f0440
commit 521f551b84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,10 +251,17 @@ class driver(inputDriver):
return return
for fd in self.iDevices: for fd in self.iDevices:
self.ungrabDevice(fd) self.ungrabDevice(fd)
def addDevice(self, fd): def createUInputDev(self, fd):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):
self.uDevices[fd] = None self.uDevices[fd] = None
return return
try:
test = self.uDevices[fd]
return
except KeyError:
pass
if not self.uDevices[fd]:
return
try: try:
self.uDevices[fd] = UInput.from_device(self.iDevices[fd]) self.uDevices[fd] = UInput.from_device(self.iDevices[fd])
except Exception as e: except Exception as e:
@ -270,6 +277,8 @@ class driver(inputDriver):
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: init Uinput not possible: ' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: init Uinput not possible: ' + str(e),debug.debugLevel.ERROR)
return return
def addDevice(self, fd):
self.createUInputDev(fd)
self.grabDevice(fd) self.grabDevice(fd)
def grabDevice(self, fd): def grabDevice(self, fd):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'grabDevices'):