adjust onScreenUpdate commands

This commit is contained in:
chrys 2017-06-30 20:19:55 +02:00
parent b15efce9d7
commit 96a1055ec3
2 changed files with 9 additions and 13 deletions

View File

@ -17,32 +17,29 @@ class command():
return 'No Description found'
def run(self):
print('drin')
#if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
# return
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
return
# detect typing or chilling
#if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
# return
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
return
# More than just a deletion happend
if self.env['runtime']['screenManager'].isDelta():
return
# no deletion
#if not self.env['runtime']['screenManager'].isNegativeDelta():
# return
if not self.env['runtime']['screenManager'].isNegativeDelta():
return
# too much for a single backspace...
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
#if len(self.env['screen']['newNegativeDelta']) > 2:
# return
if len(self.env['screen']['newNegativeDelta']) > 2:
return
currNegativeDelta = self.env['screen']['newNegativeDelta']
#if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
# currNegativeDelta.strip() != '':
# currNegativeDelta = currNegativeDelta.strip()
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
print('danach',currNegativeDelta,'d')
def setCallback(self, callback):
pass

View File

@ -17,13 +17,12 @@ class command():
return 'No Description found'
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
return
# is there something to read?
if not self.env['runtime']['screenManager'].isDelta():
return
if len(self.env['screen']['newDelta']) >=2:
if len(self.env['screen']['newDelta']) <=2:
return
# its a cursor movement (experimental) - maybe also check current shortcut string?