no input/ screen processing while vmenu

This commit is contained in:
chrys 2019-02-03 23:52:12 +01:00
parent 4dc0d7b204
commit d65a3fc596
2 changed files with 21 additions and 19 deletions

View File

@ -68,6 +68,8 @@ class fenrirManager():
else: else:
if self.environment['runtime']['helpManager'].isTutorialMode(): if self.environment['runtime']['helpManager'].isTutorialMode():
self.environment['runtime']['inputManager'].clearEventBuffer() self.environment['runtime']['inputManager'].clearEventBuffer()
if self.environment['runtime']['vmenuManager'].getActive():
self.environment['runtime']['inputManager'].clearEventBuffer()
self.detectShortcutCommand() self.detectShortcutCommand()
@ -76,7 +78,7 @@ class fenrirManager():
if self.singleKeyCommand: if self.singleKeyCommand:
if self.environment['runtime']['inputManager'].noKeyPressed(): if self.environment['runtime']['inputManager'].noKeyPressed():
self.environment['runtime']['inputManager'].clearEventBuffer() self.environment['runtime']['inputManager'].clearEventBuffer()
else: else:
self.environment['runtime']['inputManager'].writeEventBuffer() self.environment['runtime']['inputManager'].writeEventBuffer()
if self.environment['runtime']['inputManager'].noKeyPressed(): if self.environment['runtime']['inputManager'].noKeyPressed():
self.modifierInput = False self.modifierInput = False
@ -91,7 +93,6 @@ class fenrirManager():
if event['Data'] == b'': if event['Data'] == b'':
return return
self.environment['runtime']['byteManager'].handleByteInput(event['Data']) self.environment['runtime']['byteManager'].handleByteInput(event['Data'])
self.environment['runtime']['commandManager'].executeDefaultTrigger('onByteInput') self.environment['runtime']['commandManager'].executeDefaultTrigger('onByteInput')
def handleExecuteCommand(self, event): def handleExecuteCommand(self, event):
if not event['Data']: if not event['Data']:
@ -109,7 +110,7 @@ class fenrirManager():
if not event['Data']: if not event['Data']:
return return
self.environment['runtime']['remoteManager'].handleRemoteIncomming(event['Data']) self.environment['runtime']['remoteManager'].handleRemoteIncomming(event['Data'])
def handleScreenChange(self, event): def handleScreenChange(self, event):
self.environment['runtime']['screenManager'].hanldeScreenChange(event['Data']) self.environment['runtime']['screenManager'].hanldeScreenChange(event['Data'])
''' '''
if self.environment['runtime']['applicationManager'].isApplicationChange(): if self.environment['runtime']['applicationManager'].isApplicationChange():
@ -118,8 +119,11 @@ class fenrirManager():
self.environment['runtime']['applicationManager'].getPrevApplication(), \ self.environment['runtime']['applicationManager'].getPrevApplication(), \
self.environment['runtime']['applicationManager'].getCurrentApplication()) self.environment['runtime']['applicationManager'].getCurrentApplication())
''' '''
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenChanged') if self.environment['runtime']['vmenuManager'].getActive():
self.environment['runtime']['screenDriver'].getCurrScreen() return
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenChanged')
self.environment['runtime']['screenDriver'].getCurrScreen()
def handleScreenUpdate(self, event): def handleScreenUpdate(self, event):
#startTime = time.time() #startTime = time.time()
self.environment['runtime']['screenManager'].handleScreenUpdate(event['Data']) self.environment['runtime']['screenManager'].handleScreenUpdate(event['Data'])
@ -128,26 +132,24 @@ class fenrirManager():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onApplicationChange') self.environment['runtime']['commandManager'].executeDefaultTrigger('onApplicationChange')
self.environment['runtime']['commandManager'].executeSwitchTrigger('onSwitchApplicationProfile', \ self.environment['runtime']['commandManager'].executeSwitchTrigger('onSwitchApplicationProfile', \
self.environment['runtime']['applicationManager'].getPrevApplication(), \ self.environment['runtime']['applicationManager'].getPrevApplication(), \
self.environment['runtime']['applicationManager'].getCurrentApplication()) self.environment['runtime']['applicationManager'].getCurrentApplication())
''' '''
# timout for the last keypress # timout for the last keypress
if time.time() - self.environment['runtime']['inputManager'].getLastInputTime() >= 0.3: if time.time() - self.environment['runtime']['inputManager'].getLastInputTime() >= 0.3:
self.environment['runtime']['inputManager'].clearLastDeepInput() self.environment['runtime']['inputManager'].clearLastDeepInput()
# has cursor changed? # has cursor changed?
if self.environment['runtime']['cursorManager'].isCursorVerticalMove() or \ if self.environment['runtime']['cursorManager'].isCursorVerticalMove() or \
self.environment['runtime']['cursorManager'].isCursorHorizontalMove(): self.environment['runtime']['cursorManager'].isCursorHorizontalMove():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onCursorChange') self.environment['runtime']['commandManager'].executeDefaultTrigger('onCursorChange')
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate') self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
self.environment['runtime']['inputManager'].clearLastDeepInput() self.environment['runtime']['inputManager'].clearLastDeepInput()
#print('handleScreenUpdate:',time.time() - startTime) #print('handleScreenUpdate:',time.time() - startTime)
def handlePlugInputDevice(self, event): def handlePlugInputDevice(self, event):
self.environment['runtime']['inputManager'].handlePlugInputDevice(event['Data']) self.environment['runtime']['inputManager'].handlePlugInputDevice(event['Data'])
self.environment['runtime']['commandManager'].executeDefaultTrigger('onPlugInputDevice', force=True) self.environment['runtime']['commandManager'].executeDefaultTrigger('onPlugInputDevice', force=True)
def handleHeartBeat(self, event): def handleHeartBeat(self, event):
self.environment['runtime']['commandManager'].executeDefaultTrigger('onHeartBeat',force=True) self.environment['runtime']['commandManager'].executeDefaultTrigger('onHeartBeat',force=True)
#self.environment['runtime']['outputManager'].brailleText(flush=False) #self.environment['runtime']['outputManager'].brailleText(flush=False)
def detectShortcutCommand(self): def detectShortcutCommand(self):
@ -163,7 +165,7 @@ class fenrirManager():
if not( self.singleKeyCommand and self.environment['runtime']['inputManager'].noKeyPressed()): if not( self.singleKeyCommand and self.environment['runtime']['inputManager'].noKeyPressed()):
shortcut = self.environment['runtime']['inputManager'].getCurrShortcut() shortcut = self.environment['runtime']['inputManager'].getCurrShortcut()
self.command = self.environment['runtime']['inputManager'].getCommandForShortcut(shortcut) self.command = self.environment['runtime']['inputManager'].getCommandForShortcut(shortcut)
if not self.modifierInput: if not self.modifierInput:
if self.environment['runtime']['inputManager'].isKeyPress(): if self.environment['runtime']['inputManager'].isKeyPress():
if self.command != '': if self.command != '':
@ -172,12 +174,12 @@ class fenrirManager():
if not (self.singleKeyCommand or self.modifierInput): if not (self.singleKeyCommand or self.modifierInput):
return return
# fire event # fire event
if self.command != '': if self.command != '':
if self.modifierInput: if self.modifierInput:
self.environment['runtime']['eventManager'].putToEventQueue(fenrirEventType.ExecuteCommand, self.command) self.environment['runtime']['eventManager'].putToEventQueue(fenrirEventType.ExecuteCommand, self.command)
self.command = '' self.command = ''
else: else:
if self.singleKeyCommand: if self.singleKeyCommand:
if self.environment['runtime']['inputManager'].noKeyPressed(): if self.environment['runtime']['inputManager'].noKeyPressed():
self.environment['runtime']['eventManager'].putToEventQueue(fenrirEventType.ExecuteCommand, self.command) self.environment['runtime']['eventManager'].putToEventQueue(fenrirEventType.ExecuteCommand, self.command)
@ -217,7 +219,7 @@ class fenrirManager():
self.shutdownRequest() self.shutdownRequest()
def shutdown(self): def shutdown(self):
self.environment['runtime']['eventManager'].stopMainEventLoop() self.environment['runtime']['eventManager'].stopMainEventLoop()
self.environment['runtime']['outputManager'].presentText(_("Quit Fenrir"), soundIcon='ScreenReaderOff', interrupt=True) self.environment['runtime']['outputManager'].presentText(_("Quit Fenrir"), soundIcon='ScreenReaderOff', interrupt=True)
self.environment['runtime']['eventManager'].cleanEventQueue() self.environment['runtime']['eventManager'].cleanEventQueue()
time.sleep(0.6) time.sleep(0.6)

View File

@ -14,5 +14,5 @@ generalData = {
'managerList':[ 'attributeManager','punctuationManager', 'byteManager', 'cursorManager', 'applicationManager', 'commandManager' 'managerList':[ 'attributeManager','punctuationManager', 'byteManager', 'cursorManager', 'applicationManager', 'commandManager'
, 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager','processManager', 'debug'], , 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager','processManager', 'debug'],
'commandFolderList':['commands','onKeyInput', 'onByteInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice' 'commandFolderList':['commands','onKeyInput', 'onByteInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice'
,'onApplicationChange','onSwitchApplicationProfile','help',], ,'onApplicationChange','onSwitchApplicationProfile','help','vmenu-navigation',],
} }