fix command handling

This commit is contained in:
chrys 2018-03-07 00:04:07 +01:00
parent 1c274a7c11
commit 54e88b0c93

View File

@ -66,7 +66,7 @@ class driver(inputDriver):
if devices: if devices:
while monitor.poll(0.5): while monitor.poll(0.5):
time.sleep(0.08) time.sleep(0.08)
#eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None})
return time.time() return time.time()
def plugInputDeviceWatchdogTimer(self, active): def plugInputDeviceWatchdogTimer(self, active):
time.sleep(2.5) time.sleep(2.5)
@ -77,11 +77,11 @@ 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
try: try:
event = self.iDevices[fd].read_one() event = self.iDevices[fd].read_one()
except: except:
self.removeDevice(fd) self.removeDevice(fd)
foreward = False
while(event): while(event):
self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event]) self.env['input']['eventBuffer'].append( [self.iDevices[fd], self.uDevices[fd], event])
if event.type == evdev.events.EV_KEY: if event.type == evdev.events.EV_KEY: