add double tap detection

This commit is contained in:
chrys 2016-09-27 23:52:46 +02:00
parent f67ada9a05
commit d8c597c83f

View File

@ -41,6 +41,7 @@ class inputManager():
self.env['input']['currInput'] = sorted(self.env['input']['currInput'])
if len(self.env['input']['currInput']) == 0:
self.env['input']['prevDeepestInput'] = []
self.env['input']['shortcutRepeat'] = 1
elif mEvent['EventState'] == 1:
if not mEvent['EventName'] in self.env['input']['currInput']:
self.env['input']['currInput'].append(mEvent['EventName'])
@ -48,6 +49,9 @@ class inputManager():
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 self.env['input']['prevDeepestInput'] == self.env['input']['currInput']:
self.env['input']['shortcutRepeat'] += 1
elif mEvent['EventState'] == 2:
pass
else:
@ -59,7 +63,6 @@ class inputManager():
self.env['input']['oldScrollLock'] = self.env['input']['newScrollLock']
self.env['input']['newScrollLock'] = self.env['runtime']['inputDriver'].getScrollLock()
self.env['input']['lastInputTime'] = time.time()
self.env['input']['shortcutRepeat'] = 1
return eventReceived
def grabDevices(self):