add page mode. make fixCell/page mode configurable
This commit is contained in:
parent
87a9672c03
commit
e9332caa93
@ -75,6 +75,10 @@ flushMode=word
|
|||||||
# seconds to flush or
|
# seconds to flush or
|
||||||
# -1 = no automatic flush (manual via shortcut)
|
# -1 = no automatic flush (manual via shortcut)
|
||||||
flushTimeout=3
|
flushTimeout=3
|
||||||
|
# how should the cursor be focused?
|
||||||
|
# page = if cursor cross the border move to next page and start at beginn
|
||||||
|
# fixCell = ajust the cursor on an special cell where it is always placed. the display scroll here more smooth.
|
||||||
|
cursorFocusMode=page
|
||||||
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
||||||
# 0 = first cell on device
|
# 0 = first cell on device
|
||||||
# -1 = last cell on device
|
# -1 = last cell on device
|
||||||
|
@ -76,6 +76,10 @@ flushMode=word
|
|||||||
# seconds to flush or
|
# seconds to flush or
|
||||||
# -1 = no automatic flush (manual via shortcut)
|
# -1 = no automatic flush (manual via shortcut)
|
||||||
flushTimeout=3
|
flushTimeout=3
|
||||||
|
# how should the cursor be focused?
|
||||||
|
# page = if cursor cross the border move to next page and start at beginn
|
||||||
|
# fixCell = ajust the cursor on an special cell where it is always placed. the display scroll here more smooth.
|
||||||
|
cursorFocusMode=page
|
||||||
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
||||||
# 0 = first cell on device
|
# 0 = first cell on device
|
||||||
# -1 = last cell on device
|
# -1 = last cell on device
|
||||||
|
@ -75,6 +75,10 @@ flushMode=word
|
|||||||
# seconds to flush or
|
# seconds to flush or
|
||||||
# -1 = no automatic flush (manual via shortcut)
|
# -1 = no automatic flush (manual via shortcut)
|
||||||
flushTimeout=3
|
flushTimeout=3
|
||||||
|
# how should the cursor be focused?
|
||||||
|
# page = if cursor cross the border move to next page and start at beginn
|
||||||
|
# fixCell = ajust the cursor on an special cell where it is always placed. the display scroll here more smooth.
|
||||||
|
cursorFocusMode=page
|
||||||
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
||||||
# 0 = first cell on device
|
# 0 = first cell on device
|
||||||
# -1 = last cell on device
|
# -1 = last cell on device
|
||||||
|
@ -33,6 +33,10 @@ flushMode=word
|
|||||||
# seconds to flush or
|
# seconds to flush or
|
||||||
# -1 = no automatic flush (manual via shortcut)
|
# -1 = no automatic flush (manual via shortcut)
|
||||||
flushTimeout=3
|
flushTimeout=3
|
||||||
|
# how should the cursor be focused?
|
||||||
|
# page = if cursor cross the border move to next page and start at beginn
|
||||||
|
# fixCell = ajust the cursor on an special cell where it is always placed. the display scroll here more smooth.
|
||||||
|
cursorFocusMode=page
|
||||||
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
# define the cell on the Braille device where fenrir should scroll and keep the cursor
|
||||||
# 0 = first cell on device
|
# 0 = first cell on device
|
||||||
# -1 = last cell on device
|
# -1 = last cell on device
|
||||||
|
@ -127,13 +127,15 @@ class outputManager():
|
|||||||
self.env['runtime']['brailleDriver'].writeText('flush'+displayText)
|
self.env['runtime']['brailleDriver'].writeText('flush'+displayText)
|
||||||
|
|
||||||
def getBrailleCursor(self):
|
def getBrailleCursor(self):
|
||||||
if self.env['runtime']['settingsManager'].getSetting('focus', 'cursorFollowMode') == 'review':
|
if self.env['runtime']['settingsManager'].getSetting('braille', 'cursorFollowMode').upper() == 'REVIEW':
|
||||||
return self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
return self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
self.env['runtime']['settingsManager'].getSetting('focus', 'cursorFollowMode') == 'manual':
|
if self.env['runtime']['settingsManager'].getSetting('braille', 'cursorFollowMode').upper() == 'MANUAL':
|
||||||
pass
|
return self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
self.env['runtime']['settingsManager'].getSetting('focus', 'cursorFollowMode') == 'last':
|
if self.env['runtime']['settingsManager'].getSetting('braille', 'cursorFollowMode').upper() == 'LAST':
|
||||||
pass
|
return self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
def getCursorCell(self):
|
return self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
|
|
||||||
|
def getFixCursorCell(self):
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsInt('braille', 'fixCursorOnCell') == -1:
|
if self.env['runtime']['settingsManager'].getSettingAsInt('braille', 'fixCursorOnCell') == -1:
|
||||||
return self.env['runtime']['brailleDriver'].getDeviceSize()[0]
|
return self.env['runtime']['brailleDriver'].getDeviceSize()[0]
|
||||||
return self.env['runtime']['settingsManager'].getSettingAsInt('braille', 'fixCursorOnCell')
|
return self.env['runtime']['settingsManager'].getSettingAsInt('braille', 'fixCursorOnCell')
|
||||||
@ -142,9 +144,12 @@ class outputManager():
|
|||||||
if text == '':
|
if text == '':
|
||||||
return ''
|
return ''
|
||||||
size = self.env['runtime']['brailleDriver'].getDeviceSize()
|
size = self.env['runtime']['brailleDriver'].getDeviceSize()
|
||||||
cursorCell = self.getCursorCell()
|
|
||||||
offsetText = text
|
offsetText = text
|
||||||
if cursor and not offset:
|
if cursor and not offset:
|
||||||
|
if self.env['runtime']['settingsManager'].getSetting('braille', 'cursorFollowMode').upper() == 'FIXCELL':
|
||||||
|
#fix cell
|
||||||
|
cursorCell = self.getFixCursorCell()
|
||||||
offsetStart = cursor['x']
|
offsetStart = cursor['x']
|
||||||
if offsetStart < size[0]:
|
if offsetStart < size[0]:
|
||||||
if offsetStart <= cursorCell:
|
if offsetStart <= cursorCell:
|
||||||
@ -153,6 +158,9 @@ class outputManager():
|
|||||||
offsetStart -= cursorCell
|
offsetStart -= cursorCell
|
||||||
if offsetStart >= len(offsetText):
|
if offsetStart >= len(offsetText):
|
||||||
offsetStart = len(offsetText) - 1
|
offsetStart = len(offsetText) - 1
|
||||||
|
else:
|
||||||
|
# page and fallback
|
||||||
|
offsetStart = int(cursor / size[0]) * size[0]
|
||||||
else:
|
else:
|
||||||
if not offset:
|
if not offset:
|
||||||
offset = {'x':0,'y':0}
|
offset = {'x':0,'y':0}
|
||||||
|
@ -33,6 +33,7 @@ settings = {
|
|||||||
'layout': 'en',
|
'layout': 'en',
|
||||||
'flushMode': 'word', #NONE,FIX,CHAR,WORD
|
'flushMode': 'word', #NONE,FIX,CHAR,WORD
|
||||||
'flushTimeout': 3,
|
'flushTimeout': 3,
|
||||||
|
'cursorFocusMode':'page', # page,fixCell
|
||||||
'fixCursorOnCell': -1,
|
'fixCursorOnCell': -1,
|
||||||
'cursorFollowMode': 'review', # none, review, last, text
|
'cursorFollowMode': 'review', # none, review, last, text
|
||||||
'panSize': 0 # 0 display size
|
'panSize': 0 # 0 display size
|
||||||
|
Loading…
Reference in New Issue
Block a user