add option to leave review on keypress and on screen change

This commit is contained in:
chrys
2017-01-30 23:47:36 +01:00
parent cea7824b3d
commit 2d77b626dc
8 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,32 @@
#!/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):
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnKeypress'):
return
if self.env['runtime']['inputManager'].noKeyPressed():
return
if self.env['runtime']['screenManager'].isScreenChange():
return
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
return
self.env['runtime']['cursorManager'].clearReviewCursor()
def setCallback(self, callback):
pass

View File

@ -17,6 +17,8 @@ class command():
return 'No Description found'
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnScreenChange'):
return
self.env['runtime']['cursorManager'].clearReviewCursor()
def setCallback(self, callback):

View File

@ -65,6 +65,8 @@ settings = {
'review':{
'lineBreak': True,
'endOfScreen': True,
'leaveReviewOnKeypress': False,
'leaveReviewOnScreenChange': True,
},
'promote':{
'enabled': True,