Update evdevDriver.py

This commit is contained in:
chrys87 2018-03-07 10:16:11 +01:00 committed by GitHub
parent c36d80e424
commit 5b239bcd61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,8 @@ class driver(inputDriver):
r, w, x = select(self.iDevices, [], [], 0.5) r, w, x = select(self.iDevices, [], [], 0.5)
for fd in r: for fd in r:
event = None event = None
foreward = False foreward = False
eventFired = False
try: try:
event = self.iDevices[fd].read_one() event = self.iDevices[fd].read_one()
except: except:
@ -98,11 +99,12 @@ class driver(inputDriver):
if not foreward: if not foreward:
if currMapEvent['EventState'] in [0,1,2]: if currMapEvent['EventState'] in [0,1,2]:
eventQueue.put({"Type":fenrirEventType.KeyboardInput,"Data":currMapEvent}) eventQueue.put({"Type":fenrirEventType.KeyboardInput,"Data":currMapEvent})
eventFired = True
else: else:
if not event.type in [0,1,4]: if not event.type in [0,1,4]:
foreward = True foreward = True
event = self.iDevices[fd].read_one() event = self.iDevices[fd].read_one()
if foreward: if foreward and not eventFired:
self.writeEventBuffer() self.writeEventBuffer()
self.clearEventBuffer() self.clearEventBuffer()
def handleInputEvent(self, event): def handleInputEvent(self, event):