add onCursorChange trigger; implement auto leave review mode on cursor change
This commit is contained in:
parent
3da0f6b5d8
commit
b29114abea
@ -173,7 +173,7 @@ highlight=False
|
|||||||
lineBreak=True
|
lineBreak=True
|
||||||
endOfScreen=True
|
endOfScreen=True
|
||||||
# leave the review when pressing a key
|
# leave the review when pressing a key
|
||||||
leaveReviewOnKeypress=False
|
leaveReviewOnCursorChange=True
|
||||||
# leave the review when changing the screen
|
# leave the review when changing the screen
|
||||||
leaveReviewOnScreenChange=True
|
leaveReviewOnScreenChange=True
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ highlight=False
|
|||||||
lineBreak=True
|
lineBreak=True
|
||||||
endOfScreen=True
|
endOfScreen=True
|
||||||
# leave the review when pressing a key
|
# leave the review when pressing a key
|
||||||
leaveReviewOnKeypress=False
|
leaveReviewOnCursorChange=True
|
||||||
# leave the review when changing the screen
|
# leave the review when changing the screen
|
||||||
leaveReviewOnScreenChange=True
|
leaveReviewOnScreenChange=True
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ panSizeHorizontal=0
|
|||||||
driver=vcsaDriver
|
driver=vcsaDriver
|
||||||
encoding=cp850
|
encoding=cp850
|
||||||
screenUpdateDelay=0.05
|
screenUpdateDelay=0.05
|
||||||
suspendingScreen=7
|
suspendingScreen=
|
||||||
autodetectSuspendingScreen=False
|
autodetectSuspendingScreen=True
|
||||||
|
|
||||||
[keyboard]
|
[keyboard]
|
||||||
driver=evdevDriver
|
driver=evdevDriver
|
||||||
@ -128,7 +128,7 @@ highlight=False
|
|||||||
lineBreak=True
|
lineBreak=True
|
||||||
endOfScreen=True
|
endOfScreen=True
|
||||||
# leave the review when pressing a key
|
# leave the review when pressing a key
|
||||||
leaveReviewOnKeypress=False
|
leaveReviewOnCursorChange=True
|
||||||
# leave the review when changing the screen
|
# leave the review when changing the screen
|
||||||
leaveReviewOnScreenChange=True
|
leaveReviewOnScreenChange=True
|
||||||
|
|
||||||
|
26
src/fenrir/commands/onCursorChange/66000-exit_review_mode.py
Normal file
26
src/fenrir/commands/onCursorChange/66000-exit_review_mode.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/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 _('exits review mode')
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
||||||
|
return
|
||||||
|
if self.env['runtime']['cursorManager'].isReviewMode():
|
||||||
|
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||||
|
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
@ -1,33 +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 'No Description found'
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
return
|
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnKeypress'):
|
|
||||||
return
|
|
||||||
if not 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
|
|
||||||
|
|
@ -89,6 +89,10 @@ class fenrirManager():
|
|||||||
self.environment['runtime']['applicationManager'].getPrevApplication(), \
|
self.environment['runtime']['applicationManager'].getPrevApplication(), \
|
||||||
self.environment['runtime']['applicationManager'].getCurrentApplication())
|
self.environment['runtime']['applicationManager'].getCurrentApplication())
|
||||||
'''
|
'''
|
||||||
|
# has cursor changed?
|
||||||
|
if self.environment['runtime']['cursorManager'].isCursorVerticalMove() or \
|
||||||
|
self.environment['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
|
self.environment['runtime']['commandManager'].executeDefaultTrigger('onCursorChange')
|
||||||
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
|
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
|
||||||
#print(time.time() -s)
|
#print(time.time() -s)
|
||||||
|
|
||||||
|
@ -13,6 +13,6 @@ generalData = {
|
|||||||
'prevUser':'',
|
'prevUser':'',
|
||||||
'managerList':['eventManager','punctuationManager','cursorManager','applicationManager','commandManager'
|
'managerList':['eventManager','punctuationManager','cursorManager','applicationManager','commandManager'
|
||||||
,'screenManager','inputManager','outputManager','debug'],
|
,'screenManager','inputManager','outputManager','debug'],
|
||||||
'commandFolderList':['commands','onInput','onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice'
|
'commandFolderList':['commands','onInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice'
|
||||||
,'onApplicationChange','onSwitchApplicationProfile',],
|
,'onApplicationChange','onSwitchApplicationProfile',],
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ settingsData = {
|
|||||||
'review':{
|
'review':{
|
||||||
'lineBreak': True,
|
'lineBreak': True,
|
||||||
'endOfScreen': True,
|
'endOfScreen': True,
|
||||||
'leaveReviewOnKeypress': False,
|
'leaveReviewOnCursorChange': True,
|
||||||
'leaveReviewOnScreenChange': True,
|
'leaveReviewOnScreenChange': True,
|
||||||
},
|
},
|
||||||
'promote':{
|
'promote':{
|
||||||
|
Loading…
Reference in New Issue
Block a user