improve vim/emaces
This commit is contained in:
parent
b1fe678fcb
commit
e91fd4fff0
@ -24,8 +24,10 @@ class command():
|
|||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
# this leads to problems in vim -> status line change -> no announcement
|
||||||
return
|
#if self.env['runtime']['screenManager'].isDelta():
|
||||||
|
# return
|
||||||
|
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if not self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if not self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
#!/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 ''
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
|
||||||
return
|
|
||||||
if self.env['screenData']['newAttribDelta'] != '':
|
|
||||||
return
|
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
|
||||||
return
|
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
|
||||||
return
|
|
||||||
if len(self.env['input']['currInput']) != 1:
|
|
||||||
return
|
|
||||||
if not self.env['input']['currInput'][0] in ['KEY_UP','KEY_DOWN']:
|
|
||||||
return
|
|
||||||
prevLine = self.env['screenData']['oldContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
|
||||||
currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
|
||||||
if not currLine.isspace():
|
|
||||||
currPrompt = currLine.find('$')
|
|
||||||
rootPrompt = currLine.find('#')
|
|
||||||
if currPrompt <= 0:
|
|
||||||
if rootPrompt > 0:
|
|
||||||
currPrompt = rootPrompt
|
|
||||||
else:
|
|
||||||
announce = currLine
|
|
||||||
if currPrompt > 0:
|
|
||||||
remove_digits = str.maketrans('0123456789', ' ')
|
|
||||||
if prevLine[:currPrompt].translate(remove_digits) == currLine[:currPrompt].translate(remove_digits):
|
|
||||||
announce = currLine[currPrompt+1:]
|
|
||||||
else:
|
|
||||||
announce = currLine
|
|
||||||
|
|
||||||
if currLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False)
|
|
||||||
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True
|
|
||||||
self.env['commandsIgnore']['onScreenUpdate']['CHAR_ECHO'] = True
|
|
||||||
self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -17,17 +17,20 @@ class command():
|
|||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
|
||||||
return
|
return
|
||||||
# is there something to read?
|
# is there something to read?
|
||||||
if self.env['screenData']['newDelta'] == '':
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# its a cursor movement (experimental) - maybe also check current shortcut string?
|
# its a cursor movement (experimental) - maybe also check current shortcut string?
|
||||||
|
|
||||||
if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1:
|
if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1:
|
||||||
if len(self.env['screenData']['newDelta'].strip(' \n\t')) <= 2:
|
if len(self.env['screenData']['newDelta'].strip(' \n\t')) <= 2:
|
||||||
return
|
return
|
||||||
|
if abs(self.env['screenData']['newCursor']['y'] - self.env['screenData']['oldCursor']['y']) == 1:
|
||||||
|
return
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=False, flush=False)
|
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=False, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
|
Loading…
Reference in New Issue
Block a user