inprove performance

This commit is contained in:
chrys
2016-09-25 22:14:35 +02:00
parent c3e67168a2
commit b5dc878d37
2 changed files with 12 additions and 7 deletions

View File

@ -40,6 +40,8 @@ class inputManager():
if mEvent['EventName'] in self.env['input']['currInput']:
self.env['input']['currInput'].remove(mEvent['EventName'])
self.env['input']['currInput'] = sorted(self.env['input']['currInput'])
if len(self.env['input']['prevDeepestInput']) < len(self.env['input']['currInput']):
self.env['input']['prevDeepestInput'] = self.env['input']['currInput'].copy()
elif mEvent['EventState'] == 1:
if not mEvent['EventName'] in self.env['input']['currInput']:
self.env['input']['currInput'].append(mEvent['EventName'])
@ -102,7 +104,7 @@ class inputManager():
def writeEventBuffer(self):
try:
self.env['runtime']['inputDriver'].writeEventBuffer()
time.sleep(0.005)
time.sleep(0.0005)
self.clearEventBuffer()
except Exception as e:
print(e)