improve event fire

This commit is contained in:
chrys 2018-06-28 00:01:03 +02:00
parent 6728dd5745
commit 4fdb3a5b61

View File

@ -114,7 +114,8 @@ class driver(inputDriver):
eventQueue.put({"Type":fenrirEventType.KeyboardInput,"Data":currMapEvent.copy()}) eventQueue.put({"Type":fenrirEventType.KeyboardInput,"Data":currMapEvent.copy()})
eventFired = True eventFired = True
else: else:
if not event.type in [0,4]: pass
if event.type in [2,3]:
foreward = True foreward = True
event = self.iDevices[fd].read_one() event = self.iDevices[fd].read_one()
@ -262,12 +263,13 @@ class driver(inputDriver):
return False return False
ledState = self.getLedState(led) ledState = self.getLedState(led)
for i in self.iDevices: for i in self.iDevices:
# 17 LEDs if self.gDevices[i]:
if 17 in self.iDevices[i].capabilities(): # 17 LEDs
if ledState == 1: if 17 in self.iDevices[i].capabilities():
self.iDevices[i].set_led(led , 0) if ledState == 1:
else: self.iDevices[i].set_led(led , 0)
self.iDevices[i].set_led(led , 1) else:
self.iDevices[i].set_led(led , 1)
def grabAllDevices(self): def grabAllDevices(self):
if not self._initialized: if not self._initialized:
return return