dont overflow double tap -> reset to 1

This commit is contained in:
chrys 2016-10-16 22:27:12 +02:00
parent 1a9959727f
commit c80f523ce5
2 changed files with 14 additions and 5 deletions

View File

@ -34,6 +34,7 @@ class inputManager():
if mEvent: if mEvent:
mEvent['EventName'] = self.convertEventName(mEvent['EventName']) mEvent['EventName'] = self.convertEventName(mEvent['EventName'])
eventReceived = True eventReceived = True
self.env['input']['prevInput'] = self.env['input']['currInput'].copy()
if mEvent['EventState'] == 0: if mEvent['EventState'] == 0:
if mEvent['EventName'] in self.env['input']['currInput']: if mEvent['EventName'] in self.env['input']['currInput']:
self.env['input']['currInput'].remove(mEvent['EventName']) self.env['input']['currInput'].remove(mEvent['EventName'])
@ -66,7 +67,8 @@ class inputManager():
self.env['input']['newCapsLock'] = self.env['runtime']['inputDriver'].getCapslock() self.env['input']['newCapsLock'] = self.env['runtime']['inputDriver'].getCapslock()
self.env['input']['oldScrollLock'] = self.env['input']['newScrollLock'] self.env['input']['oldScrollLock'] = self.env['input']['newScrollLock']
self.env['input']['newScrollLock'] = self.env['runtime']['inputDriver'].getScrollLock() self.env['input']['newScrollLock'] = self.env['runtime']['inputDriver'].getScrollLock()
if self.noKeyPressed():
self.env['input']['prevInput'] = []
return eventReceived return eventReceived
def grabDevices(self): def grabDevices(self):
@ -138,7 +140,8 @@ class inputManager():
shortcut = [] shortcut = []
shortcut.append(self.env['input']['shortcutRepeat']) shortcut.append(self.env['input']['shortcutRepeat'])
shortcut.append(self.env['input']['prevDeepestInput']) shortcut.append(self.env['input']['prevDeepestInput'])
return str(shortcut)
def getPrevShortcut(self): def getPrevShortcut(self):
shortcut = [] shortcut = []
shortcut.append(self.env['input']['shortcutRepeat']) shortcut.append(self.env['input']['shortcutRepeat'])
@ -149,6 +152,12 @@ class inputManager():
shortcut = [] shortcut = []
shortcut.append(self.env['input']['shortcutRepeat']) shortcut.append(self.env['input']['shortcutRepeat'])
shortcut.append(self.env['input']['currInput']) shortcut.append(self.env['input']['currInput'])
if len(self.env['input']['prevInput']) < len(self.env['input']['currInput']):
if self.env['input']['shortcutRepeat'] > 1 and not self.shortcutExists(str(shortcut)):
shortcut = []
self.env['input']['shortcutRepeat'] = 1
shortcut.append(self.env['input']['shortcutRepeat'])
shortcut.append(self.env['input']['currInput'])
return str(shortcut) return str(shortcut)
def isFenrirKey(self, eventName): def isFenrirKey(self, eventName):

View File

@ -22,9 +22,9 @@ settings = {
'pitch': 0.5, 'pitch': 0.5,
'capitalPitch':0.8, 'capitalPitch':0.8,
'volume': 1.0, 'volume': 1.0,
'module': '', 'module': 'espeak',
'voice': 'de', 'voice': 'en',
'language': 'de', 'language': 'en',
'autoReadIncoming': True, 'autoReadIncoming': True,
}, },
'braille':{ 'braille':{