add option to leave review on keypress and on screen change
This commit is contained in:
32
src/fenrir/commands/onInput/11000-leave_review_mode.py
Normal file
32
src/fenrir/commands/onInput/11000-leave_review_mode.py
Normal 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
|
||||
|
@ -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):
|
@ -65,6 +65,8 @@ settings = {
|
||||
'review':{
|
||||
'lineBreak': True,
|
||||
'endOfScreen': True,
|
||||
'leaveReviewOnKeypress': False,
|
||||
'leaveReviewOnScreenChange': True,
|
||||
},
|
||||
'promote':{
|
||||
'enabled': True,
|
||||
|
Reference in New Issue
Block a user