do not always grab on startup
This commit is contained in:
parent
b5850abeed
commit
d4a4605d6b
@ -194,12 +194,15 @@ class driver(inputDriver):
|
|||||||
self.updateMPiDevicesFD()
|
self.updateMPiDevicesFD()
|
||||||
|
|
||||||
def updateMPiDevicesFD(self):
|
def updateMPiDevicesFD(self):
|
||||||
for fd in self.iDevices:
|
try:
|
||||||
if not fd in self.iDevicesFD:
|
for fd in self.iDevices:
|
||||||
self.iDevicesFD.append(fd)
|
if not fd in self.iDevicesFD:
|
||||||
for fd in self.iDevicesFD:
|
self.iDevicesFD.append(fd)
|
||||||
if not fd in self.iDevices:
|
for fd in self.iDevicesFD:
|
||||||
self.iDevicesFD.remove(fd)
|
if not fd in self.iDevices:
|
||||||
|
self.iDevicesFD.remove(fd)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
def mapEvent(self, event):
|
def mapEvent(self, event):
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return None
|
return None
|
||||||
@ -276,8 +279,9 @@ class driver(inputDriver):
|
|||||||
return
|
return
|
||||||
def addDevice(self, newDevice):
|
def addDevice(self, newDevice):
|
||||||
self.iDevices[newDevice.fd] = newDevice
|
self.iDevices[newDevice.fd] = newDevice
|
||||||
|
self.gDevices[newDevice.fd] = False
|
||||||
self.createUInputDev(newDevice.fd)
|
self.createUInputDev(newDevice.fd)
|
||||||
self.grabDevice(newDevice.fd)
|
#self.grabDevice(newDevice.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'):
|
||||||
return
|
return
|
||||||
@ -340,6 +344,5 @@ class driver(inputDriver):
|
|||||||
self.removeDevice(fd)
|
self.removeDevice(fd)
|
||||||
self.iDevices.clear()
|
self.iDevices.clear()
|
||||||
self.uDevices.clear()
|
self.uDevices.clear()
|
||||||
|
self.gDevices.clear()
|
||||||
self.iDeviceNo = 0
|
self.iDeviceNo = 0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user