initial onApplicationChange trigger
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'No description found'
|
||||
def run(self):
|
||||
print('new %s', self.env['screenData']['newApplication'])
|
||||
print('old %s', self.env['screenData']['oldApplication'])
|
||||
print('-----------')
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
@ -16,13 +16,15 @@ class commandManager():
|
||||
self.env['runtime']['commandManager'].loadCommands('commands')
|
||||
self.env['runtime']['commandManager'].loadCommands('onInput')
|
||||
self.env['runtime']['commandManager'].loadCommands('onScreenUpdate')
|
||||
self.env['runtime']['commandManager'].loadCommands('onScreenChanged')
|
||||
self.env['runtime']['commandManager'].loadCommands('onScreenChanged')
|
||||
self.env['runtime']['commandManager'].loadCommands('onApplicationChange')
|
||||
|
||||
def shutdown(self):
|
||||
self.env['runtime']['commandManager'].shutdownCommands('commands')
|
||||
self.env['runtime']['commandManager'].shutdownCommands('onInput')
|
||||
self.env['runtime']['commandManager'].shutdownCommands('onScreenUpdate')
|
||||
self.env['runtime']['commandManager'].shutdownCommands('onScreenChanged')
|
||||
self.env['runtime']['commandManager'].shutdownCommands('onApplicationChange')
|
||||
|
||||
def loadCommands(self, section='commands'):
|
||||
commandFolder = "commands/" + section +"/"
|
||||
|
@ -33,7 +33,9 @@ commands = {
|
||||
'onScreenChanged':{
|
||||
},
|
||||
'onScreenUpdate':{
|
||||
},
|
||||
},
|
||||
'onApplicationChange':{
|
||||
},
|
||||
'commands':{
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ class fenrir():
|
||||
print(e)
|
||||
self.environment['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
|
||||
if self.environment['screenData']['newApplication'] != self.environment['screenData']['oldApplication']:
|
||||
self.environment['runtime']['commandManager'].executeTriggerCommands('onApplicationChange')
|
||||
self.environment['runtime']['commandManager'].executeTriggerCommands('onInput')
|
||||
if self.environment['screenData']['newTTY'] == self.environment['screenData']['oldTTY']:
|
||||
self.environment['runtime']['commandManager'].executeTriggerCommands('onScreenUpdate')
|
||||
|
@ -113,7 +113,6 @@ class driver():
|
||||
self.env['screenData']['oldCursor']['y'] = 0
|
||||
self.env['screenData']['oldDelta'] = ''
|
||||
self.env['screenData']['oldNegativeDelta'] = ''
|
||||
self.env['screenData']['oldApplication'] = ''
|
||||
# always clear current deltas
|
||||
self.env['screenData']['newNegativeDelta'] = ''
|
||||
self.env['screenData']['newDelta'] = ''
|
||||
|
Reference in New Issue
Block a user