File restructuring.
This commit is contained in:
parent
78ca59a938
commit
55ce73322b
@ -1,21 +1,21 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
pass
|
pass
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
# this command is just to initialize stuff.
|
# this command is just to initialize stuff.
|
||||||
# like init index lists in memoryManager
|
# like init index lists in memoryManager
|
||||||
# it is not useful to execute it
|
# it is not useful to execute it
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
# clipboard
|
# clipboard
|
||||||
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
pass
|
pass
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import screen_utils
|
from fenrirscreenreader.utils import screen_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Reads attributes of current cursor position')
|
return _('Reads attributes of current cursor position')
|
||||||
def run(self):
|
def run(self):
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
try:
|
try:
|
||||||
attributes = self.env['runtime']['attributeManager'].getAttributeByXY( cursorPos['x'], cursorPos['y'])
|
attributes = self.env['runtime']['attributeManager'].getAttributeByXY( cursorPos['x'], cursorPos['y'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString')
|
attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString')
|
||||||
attributeFormatString = self.env['runtime']['attributeManager'].formatAttributes(attributes, attributeFormatString)
|
attributeFormatString = self.env['runtime']['attributeManager'].formatAttributes(attributes, attributeFormatString)
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('clears the currently selected clipboard')
|
return _('clears the currently selected clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['memoryManager'].clearCurrentIndexList('clipboardHistory')
|
self.env['runtime']['memoryManager'].clearCurrentIndexList('clipboardHistory')
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard cleared'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard cleared'), interrupt=True)
|
||||||
return
|
return
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('speaks the contents of the currently selected clipboard')
|
return _('speaks the contents of the currently selected clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard , interrupt=True)
|
self.env['runtime']['outputManager'].presentText(clipboard , interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('reads the contents of the current screen')
|
return _('reads the contents of the current screen')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['screen']['newContentText'].isspace():
|
if self.env['screen']['newContentText'].isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("screen is empty"), soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("screen is empty"), soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'],interrupt=True)
|
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'],interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Column number for cursor')
|
return _('Column number for cursor')
|
||||||
def run(self):
|
def run(self):
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
self.env['runtime']['outputManager'].presentText(str(cursorPos['x'] + 1) , interrupt=True)
|
self.env['runtime']['outputManager'].presentText(str(cursorPos['x'] + 1) , interrupt=True)
|
||||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
self.env['runtime']['outputManager'].announceActiveCursor()
|
||||||
self.env['runtime']['outputManager'].presentText(' column number' , interrupt=False)
|
self.env['runtime']['outputManager'].presentText(' column number' , interrupt=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Line number for cursor')
|
return _('Line number for cursor')
|
||||||
def run(self):
|
def run(self):
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
self.env['runtime']['outputManager'].presentText(str(cursorPos['y'] + 1), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(str(cursorPos['y'] + 1), interrupt=True)
|
||||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
self.env['runtime']['outputManager'].announceActiveCursor()
|
||||||
self.env['runtime']['outputManager'].presentText(' line number' , interrupt=False)
|
self.env['runtime']['outputManager'].presentText(' line number' , interrupt=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('presents the date')
|
return _('presents the date')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
||||||
|
|
||||||
# get the time formatted
|
# get the time formatted
|
||||||
dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat)
|
dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat)
|
||||||
|
|
||||||
# present the time via speak and braile, there is no soundicon, interrupt the current speech
|
# present the time via speak and braile, there is no soundicon, interrupt the current speech
|
||||||
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('decrease sound volume')
|
return _('decrease sound volume')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
||||||
|
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
||||||
if value < 0.1:
|
if value < 0.1:
|
||||||
value = 0.1
|
value = 0.1
|
||||||
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
|
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOff', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOff', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Decreases the pitch of the speech')
|
return _('Decreases the pitch of the speech')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
||||||
if value < 0.0:
|
if value < 0.0:
|
||||||
value = 0.0
|
value = 0.0
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value))
|
||||||
self.env['runtime']['outputManager'].presentText(_('{0} percent speech pitch').format(int(value * 100)), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('{0} percent speech pitch').format(int(value * 100)), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Decreases the rate of the speech')
|
return _('Decreases the rate of the speech')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
||||||
if value < 0.0:
|
if value < 0.0:
|
||||||
value = 0.0
|
value = 0.0
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Decreases the volume of the speech')
|
return _('Decreases the volume of the speech')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
||||||
if value < 0.1:
|
if value < 0.1:
|
||||||
value = 0.1
|
value = 0.1
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('exits review mode')
|
return _('exits review mode')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['cursorManager'].isReviewMode():
|
if not self.env['runtime']['cursorManager'].isReviewMode():
|
||||||
self.env['runtime']['outputManager'].presentText(_("Not in Review Mode"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Not in Review Mode"), interrupt=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||||
self.env['runtime']['outputManager'].presentText(_("Exiting Review Mode"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Exiting Review Mode"), interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,39 +1,39 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment, scriptPath=''):
|
def initialize(self, environment, scriptPath=''):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('export the current fenrir clipboard to a file')
|
return _('export the current fenrir clipboard to a file')
|
||||||
def run(self):
|
def run(self):
|
||||||
clipboardFilePath = self.env['runtime']['settingsManager'].getSetting('general', 'clipboardExportPath')
|
clipboardFilePath = self.env['runtime']['settingsManager'].getSetting('general', 'clipboardExportPath')
|
||||||
clipboardFilePath = clipboardFilePath.replace('$user',self.env['general']['currUser'])
|
clipboardFilePath = clipboardFilePath.replace('$user',self.env['general']['currUser'])
|
||||||
clipboardFilePath = clipboardFilePath.replace('$USER',self.env['general']['currUser'])
|
clipboardFilePath = clipboardFilePath.replace('$USER',self.env['general']['currUser'])
|
||||||
clipboardFilePath = clipboardFilePath.replace('$User',self.env['general']['currUser'])
|
clipboardFilePath = clipboardFilePath.replace('$User',self.env['general']['currUser'])
|
||||||
clipboardFile = open(clipboardFilePath,'w')
|
clipboardFile = open(clipboardFilePath,'w')
|
||||||
try:
|
try:
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
clipboardFile.write(clipboard)
|
clipboardFile.write(clipboard)
|
||||||
clipboardFile.close()
|
clipboardFile.close()
|
||||||
os.chmod(clipboardFilePath, 0o666)
|
os.chmod(clipboardFilePath, 0o666)
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard exported to file'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard exported to file'), interrupt=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['debug'].writeDebugOut('export_clipboard_to_file:run: Filepath:'+ clipboardFile +' trace:' + str(e),debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut('export_clipboard_to_file:run: Filepath:'+ clipboardFile +' trace:' + str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,77 +1,77 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import subprocess, os
|
import subprocess, os
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import _thread
|
import _thread
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Export current fenrir clipboard to X or GUI clipboard')
|
return _('Export current fenrir clipboard to X or GUI clipboard')
|
||||||
def run(self):
|
def run(self):
|
||||||
_thread.start_new_thread(self._threadRun , ())
|
_thread.start_new_thread(self._threadRun , ())
|
||||||
def _threadRun(self):
|
def _threadRun(self):
|
||||||
try:
|
try:
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
user = self.env['general']['currUser']
|
user = self.env['general']['currUser']
|
||||||
|
|
||||||
# First try to find xclip in common locations
|
# First try to find xclip in common locations
|
||||||
xclip_paths = [
|
xclip_paths = [
|
||||||
'/usr/bin/xclip',
|
'/usr/bin/xclip',
|
||||||
'/bin/xclip',
|
'/bin/xclip',
|
||||||
'/usr/local/bin/xclip'
|
'/usr/local/bin/xclip'
|
||||||
]
|
]
|
||||||
|
|
||||||
xclip_path = None
|
xclip_path = None
|
||||||
for path in xclip_paths:
|
for path in xclip_paths:
|
||||||
if os.path.isfile(path) and os.access(path, os.X_OK):
|
if os.path.isfile(path) and os.access(path, os.X_OK):
|
||||||
xclip_path = path
|
xclip_path = path
|
||||||
break
|
break
|
||||||
|
|
||||||
if not xclip_path:
|
if not xclip_path:
|
||||||
self.env['runtime']['outputManager'].presentText(
|
self.env['runtime']['outputManager'].presentText(
|
||||||
'xclip not found in common locations',
|
'xclip not found in common locations',
|
||||||
interrupt=True
|
interrupt=True
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
for display in range(10):
|
for display in range(10):
|
||||||
p = Popen(
|
p = Popen(
|
||||||
['su', user, '-p', '-c', f"{xclip_path} -d :{display} -selection clipboard"],
|
['su', user, '-p', '-c', f"{xclip_path} -d :{display} -selection clipboard"],
|
||||||
stdin=PIPE, stdout=PIPE, stderr=PIPE, preexec_fn=os.setpgrp
|
stdin=PIPE, stdout=PIPE, stderr=PIPE, preexec_fn=os.setpgrp
|
||||||
)
|
)
|
||||||
stdout, stderr = p.communicate(input=clipboard.encode('utf-8'))
|
stdout, stderr = p.communicate(input=clipboard.encode('utf-8'))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
|
|
||||||
stderr = stderr.decode('utf-8')
|
stderr = stderr.decode('utf-8')
|
||||||
stdout = stdout.decode('utf-8')
|
stdout = stdout.decode('utf-8')
|
||||||
|
|
||||||
if stderr == '':
|
if stderr == '':
|
||||||
break
|
break
|
||||||
|
|
||||||
if stderr != '':
|
if stderr != '':
|
||||||
self.env['runtime']['outputManager'].presentText(stderr, soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(stderr, soundIcon='', interrupt=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText('exported to the X session.', interrupt=True)
|
self.env['runtime']['outputManager'].presentText('exported to the X session.', interrupt=True)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False)
|
||||||
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('selects the first clipboard')
|
return _('selects the first clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
self.env['runtime']['memoryManager'].setFirstIndex('clipboardHistory')
|
self.env['runtime']['memoryManager'].setFirstIndex('clipboardHistory')
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('sends the following keypress to the terminal or application')
|
return _('sends the following keypress to the terminal or application')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['input']['keyForeward'] = 3
|
self.env['input']['keyForeward'] = 3
|
||||||
self.env['runtime']['outputManager'].presentText(_('Forward next keypress'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('Forward next keypress'), interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import subprocess, os
|
import subprocess, os
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import _thread
|
import _thread
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment, scriptPath=''):
|
def initialize(self, environment, scriptPath=''):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.scriptPath = scriptPath
|
self.scriptPath = scriptPath
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _("imports the graphical clipboard to Fenrir's clipboard")
|
return _("imports the graphical clipboard to Fenrir's clipboard")
|
||||||
def run(self):
|
def run(self):
|
||||||
_thread.start_new_thread(self._threadRun , ())
|
_thread.start_new_thread(self._threadRun , ())
|
||||||
def _threadRun(self):
|
def _threadRun(self):
|
||||||
try:
|
try:
|
||||||
# Find xclip path
|
# Find xclip path
|
||||||
xclip_paths = ['/usr/bin/xclip', '/bin/xclip', '/usr/local/bin/xclip']
|
xclip_paths = ['/usr/bin/xclip', '/bin/xclip', '/usr/local/bin/xclip']
|
||||||
xclip_path = None
|
xclip_path = None
|
||||||
for path in xclip_paths:
|
for path in xclip_paths:
|
||||||
if os.path.isfile(path) and os.access(path, os.X_OK):
|
if os.path.isfile(path) and os.access(path, os.X_OK):
|
||||||
xclip_path = path
|
xclip_path = path
|
||||||
break
|
break
|
||||||
if not xclip_path:
|
if not xclip_path:
|
||||||
self.env['runtime']['outputManager'].presentText('xclip not found in common locations', interrupt=True)
|
self.env['runtime']['outputManager'].presentText('xclip not found in common locations', interrupt=True)
|
||||||
return
|
return
|
||||||
xClipboard = ''
|
xClipboard = ''
|
||||||
for display in range(10):
|
for display in range(10):
|
||||||
p = Popen('su ' + self.env['general']['currUser'] + ' -p -c "' + xclip_path + ' -d :' + str(display) + ' -o"', stdout=PIPE, stderr=PIPE, shell=True)
|
p = Popen('su ' + self.env['general']['currUser'] + ' -p -c "' + xclip_path + ' -d :' + str(display) + ' -o"', stdout=PIPE, stderr=PIPE, shell=True)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
stderr = stderr.decode('utf-8')
|
stderr = stderr.decode('utf-8')
|
||||||
xClipboard = stdout.decode('utf-8')
|
xClipboard = stdout.decode('utf-8')
|
||||||
if (stderr == ''):
|
if (stderr == ''):
|
||||||
break
|
break
|
||||||
if stderr != '':
|
if stderr != '':
|
||||||
self.env['runtime']['outputManager'].presentText(stderr , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(stderr , soundIcon='', interrupt=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', xClipboard)
|
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', xClipboard)
|
||||||
self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True)
|
self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True)
|
||||||
self.env['runtime']['outputManager'].presentText(xClipboard, soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(xClipboard, soundIcon='', interrupt=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('adjusts the volume for in coming sounds')
|
return _('adjusts the volume for in coming sounds')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
||||||
|
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
||||||
if value > 1.0:
|
if value > 1.0:
|
||||||
value = 1.0
|
value = 1.0
|
||||||
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
|
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOn', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOn', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Increases the pitch of the speech')
|
return _('Increases the pitch of the speech')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
||||||
if value > 1.0:
|
if value > 1.0:
|
||||||
value = 1.0
|
value = 1.0
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent speech pitch").format(int(value * 100)), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent speech pitch").format(int(value * 100)), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Increase the speech rate')
|
return _('Increase the speech rate')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
||||||
if value > 1.0:
|
if value > 1.0:
|
||||||
value = 1.0
|
value = 1.0
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import math
|
import math
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Increase the speech volume')
|
return _('Increase the speech volume')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
||||||
if value > 1.0:
|
if value > 1.0:
|
||||||
value = 1.0
|
value = 1.0
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value))
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('selects the last clipboard')
|
return _('selects the last clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
self.env['runtime']['memoryManager'].setLastIndex('clipboardHistory')
|
self.env['runtime']['memoryManager'].setLastIndex('clipboardHistory')
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Presents the text which was last received')
|
return _('Presents the text which was last received')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=True)
|
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('selects the next clipboard')
|
return _('selects the next clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
self.env['runtime']['memoryManager'].getNextIndex('clipboardHistory')
|
self.env['runtime']['memoryManager'].getNextIndex('clipboardHistory')
|
||||||
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
|
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
|
||||||
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
|
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
if isFirst:
|
if isFirst:
|
||||||
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
|
||||||
if isLast:
|
if isLast:
|
||||||
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
|
||||||
|
|
||||||
speechInterrupt = not(isLast or isFirst)
|
speechInterrupt = not(isLast or isFirst)
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
|
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('pastes the text from the currently selected clipboard')
|
return _('pastes the text from the currently selected clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True)
|
self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True)
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
self.env['runtime']['screenManager'].injectTextToScreen(clipboard)
|
self.env['runtime']['screenManager'].injectTextToScreen(clipboard)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('selects the previous clipboard')
|
return _('selects the previous clipboard')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
||||||
return
|
return
|
||||||
self.env['runtime']['memoryManager'].setPrefIndex('clipboardHistory')
|
self.env['runtime']['memoryManager'].setPrefIndex('clipboardHistory')
|
||||||
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
|
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
|
||||||
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
|
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
||||||
if isFirst:
|
if isFirst:
|
||||||
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
|
||||||
if isLast:
|
if isLast:
|
||||||
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
|
||||||
speechInterrupt = not(isLast or isFirst)
|
speechInterrupt = not(isLast or isFirst)
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
|
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('exits Fenrir')
|
return _('exits Fenrir')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['eventManager'].stopMainEventLoop()
|
self.env['runtime']['eventManager'].stopMainEventLoop()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('current line')
|
return _('current line')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currLine = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currLine = \
|
||||||
line_utils.getCurrentLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
line_utils.getCurrentLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if currLine.isspace():
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('current word.')
|
return _('current word.')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if currWord.isspace():
|
if currWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
if lineBreak:
|
if lineBreak:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
from fenrirscreenreader.utils import char_utils
|
from fenrirscreenreader.utils import char_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Phonetically spells the current word')
|
return _('Phonetically spells the current word')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if currWord.isspace():
|
if currWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
firstSequence = True
|
firstSequence = True
|
||||||
for c in currWord:
|
for c in currWord:
|
||||||
currChar = char_utils.getPhonetic(c)
|
currChar = char_utils.getPhonetic(c)
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
||||||
firstSequence = False
|
firstSequence = False
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
if lineBreak:
|
if lineBreak:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,36 +1,36 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('moves review to the next line ')
|
return _('moves review to the next line ')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||||
if not self.env['screen']['newCursorReview']:
|
if not self.env['screen']['newCursorReview']:
|
||||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextLine, endOfScreen = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextLine, endOfScreen = \
|
||||||
line_utils.getNextLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
line_utils.getNextLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if nextLine.isspace():
|
if nextLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(nextLine, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(nextLine, interrupt=True, flush=False)
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,39 +1,39 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('moves review to the next word ')
|
return _('moves review to the next word ')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||||
if self.env['screen']['newCursorReview'] == None:
|
if self.env['screen']['newCursorReview'] == None:
|
||||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if nextWord.isspace():
|
if nextWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True, flush=False)
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
if lineBreak:
|
if lineBreak:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
from fenrirscreenreader.utils import char_utils
|
from fenrirscreenreader.utils import char_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Phonetically spells the next word and moves review to it')
|
return _('Phonetically spells the next word and moves review to it')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if nextWord.isspace():
|
if nextWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
firstSequence = True
|
firstSequence = True
|
||||||
for c in nextWord:
|
for c in nextWord:
|
||||||
currChar = char_utils.getPhonetic(c)
|
currChar = char_utils.getPhonetic(c)
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
||||||
firstSequence = False
|
firstSequence = False
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
if lineBreak:
|
if lineBreak:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('moves review to the previous line ')
|
return _('moves review to the previous line ')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevLine, endOfScreen = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevLine, endOfScreen = \
|
||||||
line_utils.getPrevLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
line_utils.getPrevLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if prevLine.isspace():
|
if prevLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(prevLine, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(prevLine, interrupt=True, flush=False)
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('moves review focus to the previous word ')
|
return _('moves review focus to the previous word ')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if prevWord.isspace():
|
if prevWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True, flush=False)
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=False, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=False, soundIcon='EndOfScreen')
|
||||||
if lineBreak:
|
if lineBreak:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
from fenrirscreenreader.utils import char_utils
|
from fenrirscreenreader.utils import char_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Phonetically spells the previous word and moves review to it')
|
return _('Phonetically spells the previous word and moves review to it')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||||
|
|
||||||
if prevWord.isspace():
|
if prevWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
firstSequence = True
|
firstSequence = True
|
||||||
for c in prevWord:
|
for c in prevWord:
|
||||||
currChar = char_utils.getPhonetic(c)
|
currChar = char_utils.getPhonetic(c)
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
||||||
firstSequence = False
|
firstSequence = False
|
||||||
if endOfScreen:
|
if endOfScreen:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
||||||
if lineBreak:
|
if lineBreak:
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.core import settingsManager
|
from fenrirscreenreader.core import settingsManager
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Saves your current Fenrir settings so they are the default.')
|
return _('Saves your current Fenrir settings so they are the default.')
|
||||||
def run(self):
|
def run(self):
|
||||||
settingsFile = self.env['runtime']['settingsManager'].getSettingsFile()
|
settingsFile = self.env['runtime']['settingsManager'].getSettingsFile()
|
||||||
self.env['runtime']['settingsManager'].saveSettings(settingsFile)
|
self.env['runtime']['settingsManager'].saveSettings(settingsFile)
|
||||||
self.env['runtime']['outputManager'].presentText(_("Settings saved."), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Settings saved."), interrupt=True)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Interrupts the current presentation')
|
return _('Interrupts the current presentation')
|
||||||
def run(self):
|
def run(self):
|
||||||
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
|
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
|
||||||
return
|
return
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import subprocess, os
|
import subprocess, os
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import _thread
|
import _thread
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment, scriptPath=''):
|
def initialize(self, environment, scriptPath=''):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.scriptPath = scriptPath
|
self.scriptPath = scriptPath
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('script: {0} fullpath: {1}').format(os.path.basename(self.scriptPath), self.scriptPath)
|
return _('script: {0} fullpath: {1}').format(os.path.basename(self.scriptPath), self.scriptPath)
|
||||||
def run(self):
|
def run(self):
|
||||||
if not os.path.exists(self.scriptPath):
|
if not os.path.exists(self.scriptPath):
|
||||||
self.env['runtime']['outputManager'].presentText(_('Script file not found'), soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(_('Script file not found'), soundIcon='', interrupt=False)
|
||||||
return
|
return
|
||||||
if not os.path.isfile(self.scriptPath):
|
if not os.path.isfile(self.scriptPath):
|
||||||
self.env['runtime']['outputManager'].presentText(_('Script source is not a valid file'), soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(_('Script source is not a valid file'), soundIcon='', interrupt=False)
|
||||||
return
|
return
|
||||||
if not os.access(self.scriptPath, os.X_OK):
|
if not os.access(self.scriptPath, os.X_OK):
|
||||||
self.env['runtime']['outputManager'].presentText(_('Script file is not executable'), soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(_('Script file is not executable'), soundIcon='', interrupt=False)
|
||||||
return
|
return
|
||||||
_thread.start_new_thread(self._threadRun , ())
|
_thread.start_new_thread(self._threadRun , ())
|
||||||
|
|
||||||
def _threadRun(self):
|
def _threadRun(self):
|
||||||
try:
|
try:
|
||||||
callstring = self.scriptPath + ' ' + self.env['general']['currUser']
|
callstring = self.scriptPath + ' ' + self.env['general']['currUser']
|
||||||
p = Popen(callstring , stdout=PIPE, stderr=PIPE, shell=True)
|
p = Popen(callstring , stdout=PIPE, stderr=PIPE, shell=True)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
stdout = stdout.decode('utf-8')
|
stdout = stdout.decode('utf-8')
|
||||||
stderr = stderr.decode('utf-8')
|
stderr = stderr.decode('utf-8')
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
if stderr != '':
|
if stderr != '':
|
||||||
self.env['runtime']['outputManager'].presentText(str(stderr) , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(str(stderr) , soundIcon='', interrupt=False)
|
||||||
if stdout != '':
|
if stdout != '':
|
||||||
self.env['runtime']['outputManager'].presentText(str(stdout) , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(str(stdout) , soundIcon='', interrupt=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('disables speech until next keypress')
|
return _('disables speech until next keypress')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['outputManager'].tempDisableSpeech()
|
self.env['runtime']['outputManager'].tempDisableSpeech()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('presents the time')
|
return _('presents the time')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
|
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
|
||||||
|
|
||||||
# get the time formatted
|
# get the time formatted
|
||||||
timeString = datetime.datetime.strftime(datetime.datetime.now(), timeFormat)
|
timeString = datetime.datetime.strftime(datetime.datetime.now(), timeFormat)
|
||||||
|
|
||||||
# present the time via speak and braile, there is no soundicon, interrupt the current speech
|
# present the time via speak and braile, there is no soundicon, interrupt the current speech
|
||||||
self.env['runtime']['outputManager'].presentText(timeString , soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(timeString , soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables automatic reading of indentation level changes')
|
return _('enables or disables automatic reading of indentation level changes')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('general', 'autoPresentIndent', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent')))
|
self.env['runtime']['settingsManager'].setSetting('general', 'autoPresentIndent', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
||||||
self.env['runtime']['outputManager'].presentText(_("autoindent enabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("autoindent enabled"), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("autoindent disabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("autoindent disabled"), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables automatic reading of new text as it appears')
|
return _('enables or disables automatic reading of new text as it appears')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'autoReadIncoming', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming')))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'autoReadIncoming', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
|
||||||
self.env['runtime']['outputManager'].presentText(_("autoread enabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("autoread enabled"), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("autoread disabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("autoread disabled"), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables automatic spell checking')
|
return _('enables or disables automatic spell checking')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('general', 'autoSpellCheck', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck')))
|
self.env['runtime']['settingsManager'].setSetting('general', 'autoSpellCheck', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'):
|
||||||
self.env['runtime']['outputManager'].presentText(_("auto spellcheck enabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("auto spellcheck enabled"), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("auto spellcheck disabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("auto spellcheck disabled"), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Enables or disables automatic reading of time after specified intervals')
|
return _('Enables or disables automatic reading of time after specified intervals')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('time', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled')))
|
self.env['runtime']['settingsManager'].setSetting('time', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
|
||||||
self.env['runtime']['outputManager'].presentText(_("Automatic time announcement enabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Automatic time announcement enabled"), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Automatic time announcement disabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Automatic time announcement disabled"), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables the barrier mode')
|
return _('enables or disables the barrier mode')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('barrier', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled')))
|
self.env['runtime']['settingsManager'].setSetting('barrier', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled'):
|
||||||
self.env['runtime']['outputManager'].presentText(_("barrier mode enabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("barrier mode enabled"), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("barrier mode disabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("barrier mode disabled"), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables announcement of emoticons instead of chars')
|
return _('enables or disables announcement of emoticons instead of chars')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons')))
|
self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('emoticons enabled'), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('emoticons enabled'), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_('emoticons disabled'), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('emoticons disabled'), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables the announcement of attributes')
|
return _('enables or disables the announcement of attributes')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['settingsManager'].setSetting('general', 'hasAttributes', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes')))
|
self.env['runtime']['settingsManager'].setSetting('general', 'hasAttributes', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
||||||
self.env['runtime']['outputManager'].presentText(_("announcement of attributes enabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("announcement of attributes enabled"), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("announcement of attributes disabled"), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("announcement of attributes disabled"), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables tracking of highlighted text')
|
return _('enables or disables tracking of highlighted text')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
currMode = self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight')
|
currMode = self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight')
|
||||||
|
|
||||||
self.env['runtime']['settingsManager'].setSetting('focus', 'highlight', str(not currMode))
|
self.env['runtime']['settingsManager'].setSetting('focus', 'highlight', str(not currMode))
|
||||||
self.env['runtime']['settingsManager'].setSetting('focus', 'cursor', str(currMode))
|
self.env['runtime']['settingsManager'].setSetting('focus', 'cursor', str(currMode))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('highlight tracking'), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('highlight tracking'), soundIcon='', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_('cursor tracking'), soundIcon='', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('cursor tracking'), soundIcon='', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables sound')
|
return _('enables or disables sound')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('sound disabled'), soundIcon='SoundOff', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('sound disabled'), soundIcon='SoundOff', interrupt=True)
|
||||||
self.env['runtime']['settingsManager'].setSetting('sound', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled')))
|
self.env['runtime']['settingsManager'].setSetting('sound', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('sound enabled'), soundIcon='SoundOn', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('sound enabled'), soundIcon='SoundOn', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables speech')
|
return _('enables or disables speech')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
self.env['runtime']['outputManager'].presentText(_('speech disabled'), soundIcon='SpeechOff', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('speech disabled'), soundIcon='SpeechOff', interrupt=True)
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled')))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled')))
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
|
||||||
self.env['runtime']['outputManager'].presentText(_('speech enabled'), soundIcon='SpeechOn', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_('speech enabled'), soundIcon='SpeechOn', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
# if the filter is set
|
# if the filter is set
|
||||||
#if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
|
#if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
|
||||||
# filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
|
# filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
|
||||||
# for currInput in self.env['input']['currInput']:
|
# for currInput in self.env['input']['currInput']:
|
||||||
# if not currInput in filterList:
|
# if not currInput in filterList:
|
||||||
# return
|
# return
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('disables speech until next keypress')
|
return _('disables speech until next keypress')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['commandBuffer']['enableSpeechOnKeypress']:
|
if not self.env['commandBuffer']['enableSpeechOnKeypress']:
|
||||||
return
|
return
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
|
||||||
self.env['commandBuffer']['enableSpeechOnKeypress'] = False
|
self.env['commandBuffer']['enableSpeechOnKeypress'] = False
|
||||||
self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,55 +1,55 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# enabled?
|
# enabled?
|
||||||
active = self.env['runtime']['settingsManager'].getSettingAsInt('keyboard', 'charEchoMode')
|
active = self.env['runtime']['settingsManager'].getSettingAsInt('keyboard', 'charEchoMode')
|
||||||
# 0 = off
|
# 0 = off
|
||||||
if active == 0:
|
if active == 0:
|
||||||
return
|
return
|
||||||
# 2 = caps only
|
# 2 = caps only
|
||||||
if active == 2:
|
if active == 2:
|
||||||
if not self.env['input']['newCapsLock']:
|
if not self.env['input']['newCapsLock']:
|
||||||
return
|
return
|
||||||
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
||||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
if xMove > 3:
|
if xMove > 3:
|
||||||
return
|
return
|
||||||
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
|
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
|
||||||
if self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]:
|
if self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]:
|
||||||
return
|
return
|
||||||
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
|
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
|
||||||
if self.env['runtime']['byteManager'].getLastByteKey() in [b' ', b'\t']:
|
if self.env['runtime']['byteManager'].getLastByteKey() in [b' ', b'\t']:
|
||||||
return
|
return
|
||||||
# detect deletion or chilling
|
# detect deletion or chilling
|
||||||
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
# is there any change?
|
# is there any change?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
if len(currDelta.strip()) != len(currDelta) and \
|
if len(currDelta.strip()) != len(currDelta) and \
|
||||||
currDelta.strip() != '':
|
currDelta.strip() != '':
|
||||||
currDelta = currDelta.strip()
|
currDelta = currDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
print(currDelta)
|
print(currDelta)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# is it enabled?
|
# is it enabled?
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
return
|
return
|
||||||
# is naviation?
|
# is naviation?
|
||||||
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
|
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
|
||||||
return
|
return
|
||||||
# just when cursor move worddetection is needed
|
# just when cursor move worddetection is needed
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# currently writing
|
# currently writing
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
|
|
||||||
# is there a word?
|
# is there a word?
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
# at the end of a word
|
# at the end of a word
|
||||||
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||||
return
|
return
|
||||||
# at the end of a word
|
# at the end of a word
|
||||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||||
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
|
||||||
return
|
return
|
||||||
# detect typing or chilling
|
# detect typing or chilling
|
||||||
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
|
|
||||||
# More than just a deletion happend
|
# More than just a deletion happend
|
||||||
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
||||||
return
|
return
|
||||||
|
|
||||||
# no deletion
|
# no deletion
|
||||||
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# too much for a single backspace...
|
# too much for a single backspace...
|
||||||
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
||||||
if len(self.env['screen']['newNegativeDelta']) > 2:
|
if len(self.env['screen']['newNegativeDelta']) > 2:
|
||||||
return
|
return
|
||||||
|
|
||||||
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
||||||
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
||||||
currNegativeDelta.strip() != '':
|
currNegativeDelta.strip() != '':
|
||||||
currNegativeDelta = currNegativeDelta.strip()
|
currNegativeDelta = currNegativeDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import char_utils
|
from fenrirscreenreader.utils import char_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
# detect an change on the screen, we just want to cursor arround, so no change should appear
|
# detect an change on the screen, we just want to cursor arround, so no change should appear
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isNegativeDelta():
|
if self.env['runtime']['screenManager'].isNegativeDelta():
|
||||||
return
|
return
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# is it a horizontal change?
|
# is it a horizontal change?
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
|
|
||||||
# echo word insteed of char
|
# echo word insteed of char
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
if self.env['screen']['newCursor']['x'] == x:
|
if self.env['screen']['newCursor']['x'] == x:
|
||||||
return
|
return
|
||||||
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if not currChar.isspace():
|
if not currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,49 +1,49 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
# try to detect the tab completion by cursor change
|
# try to detect the tab completion by cursor change
|
||||||
xMove = self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']
|
xMove = self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']
|
||||||
if xMove <= 0:
|
if xMove <= 0:
|
||||||
return
|
return
|
||||||
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
|
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
|
||||||
if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]):
|
if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]):
|
||||||
if xMove < 5:
|
if xMove < 5:
|
||||||
return
|
return
|
||||||
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
|
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
|
||||||
found = False
|
found = False
|
||||||
for currByte in self.env['runtime']['byteManager'].getLastByteKey():
|
for currByte in self.env['runtime']['byteManager'].getLastByteKey():
|
||||||
if currByte == 9:
|
if currByte == 9:
|
||||||
found = True
|
found = True
|
||||||
if not found:
|
if not found:
|
||||||
if xMove < 5:
|
if xMove < 5:
|
||||||
return
|
return
|
||||||
# is there any change?
|
# is there any change?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
if not xMove == len(self.env['screen']['newDelta']):
|
if not xMove == len(self.env['screen']['newDelta']):
|
||||||
return
|
return
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
if len(currDelta.strip()) != len(currDelta) and \
|
if len(currDelta.strip()) != len(currDelta) and \
|
||||||
currDelta.strip() != '':
|
currDelta.strip() != '':
|
||||||
currDelta = currDelta.strip()
|
currDelta = currDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# is navigation?
|
# is navigation?
|
||||||
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
# just when cursor move worddetection is needed
|
# just when cursor move worddetection is needed
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# currently writing
|
# currently writing
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
|
|
||||||
# is there a word?
|
# is there a word?
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
|
|
||||||
# at the start of a word
|
# at the start of a word
|
||||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||||
(self.env['screen']['newCursor']['x'] != x):
|
(self.env['screen']['newCursor']['x'] != x):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,62 +1,62 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.lastIdent = -1
|
self.lastIdent = -1
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
self.lastIdent = 0
|
self.lastIdent = 0
|
||||||
return
|
return
|
||||||
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
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
|
||||||
|
|
||||||
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if currLine.isspace():
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
# ident
|
# ident
|
||||||
currIdent = len(currLine) - len(currLine.lstrip())
|
currIdent = len(currLine) - len(currLine.lstrip())
|
||||||
if self.lastIdent == -1:
|
if self.lastIdent == -1:
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
doInterrupt = True
|
doInterrupt = True
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]:
|
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]:
|
||||||
self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=doInterrupt)
|
self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=doInterrupt)
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
|
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
|
||||||
if self.lastIdent != currIdent:
|
if self.lastIdent != currIdent:
|
||||||
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
|
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
|
||||||
doInterrupt = False
|
doInterrupt = False
|
||||||
# barrier
|
# barrier
|
||||||
sayLine = currLine
|
sayLine = currLine
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
||||||
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
||||||
if isBarrier:
|
if isBarrier:
|
||||||
sayLine = barrierLine
|
sayLine = barrierLine
|
||||||
# output
|
# output
|
||||||
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.lastIdent = -1
|
self.lastIdent = -1
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
self.lastIdent = 0
|
self.lastIdent = 0
|
||||||
return
|
return
|
||||||
|
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
currIdent = self.env['screen']['newCursor']['x']
|
currIdent = self.env['screen']['newCursor']['x']
|
||||||
|
|
||||||
if not currLine.isspace():
|
if not currLine.isspace():
|
||||||
# ident
|
# ident
|
||||||
lastIdent, lastY, lastLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['oldContentText'])
|
lastIdent, lastY, lastLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['oldContentText'])
|
||||||
if currLine.strip() != lastLine.strip():
|
if currLine.strip() != lastLine.strip():
|
||||||
return
|
return
|
||||||
if len(currLine.lstrip()) == len(lastLine.lstrip()):
|
if len(currLine.lstrip()) == len(lastLine.lstrip()):
|
||||||
return
|
return
|
||||||
|
|
||||||
currIdent = len(currLine) - len(currLine.lstrip())
|
currIdent = len(currLine) - len(currLine.lstrip())
|
||||||
|
|
||||||
if self.lastIdent == -1:
|
if self.lastIdent == -1:
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
if currIdent <= 0:
|
if currIdent <= 0:
|
||||||
return
|
return
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]:
|
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]:
|
||||||
self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=False)
|
self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=False)
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
|
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
|
||||||
if self.lastIdent != currIdent:
|
if self.lastIdent != currIdent:
|
||||||
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=False, flush=False)
|
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=False, flush=False)
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import screen_utils
|
from fenrirscreenreader.utils import screen_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Reads attributes of current cursor position')
|
return _('Reads attributes of current cursor position')
|
||||||
def run(self):
|
def run(self):
|
||||||
# is it enabled?
|
# is it enabled?
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
||||||
return
|
return
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
|
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
|
||||||
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
|
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
|
||||||
return
|
return
|
||||||
|
|
||||||
cursorPos = self.env['screen']['newCursor']
|
cursorPos = self.env['screen']['newCursor']
|
||||||
|
|
||||||
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
|
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
|
||||||
return
|
return
|
||||||
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
|
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('exits review mode')
|
return _('exits review mode')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['cursorManager'].isReviewMode():
|
if self.env['runtime']['cursorManager'].isReviewMode():
|
||||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
||||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
if xMove > 1:
|
if xMove > 1:
|
||||||
return
|
return
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
|
||||||
return
|
return
|
||||||
# detect deletion or chilling
|
# detect deletion or chilling
|
||||||
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
# is there any change?
|
# is there any change?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
if len(currDelta.strip()) != len(currDelta) and \
|
if len(currDelta.strip()) != len(currDelta) and \
|
||||||
currDelta.strip() != '':
|
currDelta.strip() != '':
|
||||||
currDelta = currDelta.strip()
|
currDelta = currDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# try to detect the tab completion by cursor change
|
# try to detect the tab completion by cursor change
|
||||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
if xMove == 1:
|
if xMove == 1:
|
||||||
return
|
return
|
||||||
# is there any change?
|
# is there any change?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])):
|
if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])):
|
||||||
return
|
return
|
||||||
# detect deletion or chilling
|
# detect deletion or chilling
|
||||||
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
|
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
if len(currDelta.strip()) != len(currDelta) and \
|
if len(currDelta.strip()) != len(currDelta) and \
|
||||||
currDelta.strip() != '':
|
currDelta.strip() != '':
|
||||||
currDelta = currDelta.strip()
|
currDelta = currDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import char_utils
|
from fenrirscreenreader.utils import char_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
# detect an change on the screen, we just want to cursor arround, so no change should appear
|
# detect an change on the screen, we just want to cursor arround, so no change should appear
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isNegativeDelta():
|
if self.env['runtime']['screenManager'].isNegativeDelta():
|
||||||
return
|
return
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# is it a horizontal change?
|
# is it a horizontal change?
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
|
|
||||||
# echo word insteed of char
|
# echo word insteed of char
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
if self.env['screen']['newCursor']['x'] == x:
|
if self.env['screen']['newCursor']['x'] == x:
|
||||||
return
|
return
|
||||||
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if not currChar.isspace():
|
if not currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.lastIdent = -1
|
self.lastIdent = -1
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
self.lastIdent = 0
|
self.lastIdent = 0
|
||||||
return
|
return
|
||||||
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
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
|
||||||
|
|
||||||
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if currLine.isspace():
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
# ident
|
# ident
|
||||||
currIdent = len(currLine) - len(currLine.lstrip())
|
currIdent = len(currLine) - len(currLine.lstrip())
|
||||||
if self.lastIdent == -1:
|
if self.lastIdent == -1:
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
doInterrupt = True
|
doInterrupt = True
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
||||||
if self.lastIdent != currIdent:
|
if self.lastIdent != currIdent:
|
||||||
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
|
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
|
||||||
doInterrupt = False
|
doInterrupt = False
|
||||||
# barrier
|
# barrier
|
||||||
sayLine = currLine
|
sayLine = currLine
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
||||||
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
||||||
if isBarrier:
|
if isBarrier:
|
||||||
sayLine = barrierLine
|
sayLine = barrierLine
|
||||||
# output
|
# output
|
||||||
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# is it enabled?
|
# is it enabled?
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
return
|
return
|
||||||
# is naviation?
|
# is naviation?
|
||||||
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
|
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
|
||||||
return
|
return
|
||||||
# just when cursor move worddetection is needed
|
# just when cursor move worddetection is needed
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# currently writing
|
# currently writing
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
|
|
||||||
# is there a word?
|
# is there a word?
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
# at the end of a word
|
# at the end of a word
|
||||||
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||||
return
|
return
|
||||||
# at the end of a word
|
# at the end of a word
|
||||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||||
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# is navigation?
|
# is navigation?
|
||||||
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
# just when cursor move worddetection is needed
|
# just when cursor move worddetection is needed
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# currently writing
|
# currently writing
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
|
|
||||||
# is there a word?
|
# is there a word?
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
|
|
||||||
# at the start of a word
|
# at the start of a word
|
||||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||||
(self.env['screen']['newCursor']['x'] != x):
|
(self.env['screen']['newCursor']['x'] != x):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
|
||||||
return
|
return
|
||||||
# detect typing or chilling
|
# detect typing or chilling
|
||||||
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
|
|
||||||
# More than just a deletion happend
|
# More than just a deletion happend
|
||||||
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
||||||
return
|
return
|
||||||
|
|
||||||
# no deletion
|
# no deletion
|
||||||
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# too much for a single backspace...
|
# too much for a single backspace...
|
||||||
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
||||||
if len(self.env['screen']['newNegativeDelta']) > 2:
|
if len(self.env['screen']['newNegativeDelta']) > 2:
|
||||||
return
|
return
|
||||||
|
|
||||||
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
||||||
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
||||||
currNegativeDelta.strip() != '':
|
currNegativeDelta.strip() != '':
|
||||||
currNegativeDelta = currNegativeDelta.strip()
|
currNegativeDelta = currNegativeDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('exits review mode')
|
return _('exits review mode')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['cursorManager'].isReviewMode():
|
if self.env['runtime']['cursorManager'].isReviewMode():
|
||||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import screen_utils
|
from fenrirscreenreader.utils import screen_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Reads attributes of current cursor position')
|
return _('Reads attributes of current cursor position')
|
||||||
def run(self):
|
def run(self):
|
||||||
# is it enabled?
|
# is it enabled?
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
||||||
return
|
return
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
|
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
|
||||||
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
|
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
|
||||||
return
|
return
|
||||||
|
|
||||||
cursorPos = self.env['screen']['newCursor']
|
cursorPos = self.env['screen']['newCursor']
|
||||||
|
|
||||||
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
|
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
|
||||||
return
|
return
|
||||||
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
|
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
||||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
if xMove > 1:
|
if xMove > 1:
|
||||||
return
|
return
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
|
||||||
return
|
return
|
||||||
# detect deletion or chilling
|
# detect deletion or chilling
|
||||||
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
# is there any change?
|
# is there any change?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
if len(currDelta.strip()) != len(currDelta) and \
|
if len(currDelta.strip()) != len(currDelta) and \
|
||||||
currDelta.strip() != '':
|
currDelta.strip() != '':
|
||||||
currDelta = currDelta.strip()
|
currDelta = currDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# is it enabled?
|
# is it enabled?
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
return
|
return
|
||||||
# is naviation?
|
# is naviation?
|
||||||
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
|
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
|
||||||
return
|
return
|
||||||
# just when cursor move worddetection is needed
|
# just when cursor move worddetection is needed
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# currently writing
|
# currently writing
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
|
|
||||||
# is there a word?
|
# is there a word?
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
# at the end of a word
|
# at the end of a word
|
||||||
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||||
return
|
return
|
||||||
# at the end of a word
|
# at the end of a word
|
||||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||||
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
|
||||||
return
|
return
|
||||||
# detect typing or chilling
|
# detect typing or chilling
|
||||||
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
|
|
||||||
# More than just a deletion happend
|
# More than just a deletion happend
|
||||||
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
||||||
return
|
return
|
||||||
|
|
||||||
# no deletion
|
# no deletion
|
||||||
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
if not self.env['runtime']['screenManager'].isNegativeDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# too much for a single backspace...
|
# too much for a single backspace...
|
||||||
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
||||||
if len(self.env['screen']['newNegativeDelta']) > 2:
|
if len(self.env['screen']['newNegativeDelta']) > 2:
|
||||||
return
|
return
|
||||||
|
|
||||||
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
||||||
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
||||||
currNegativeDelta.strip() != '':
|
currNegativeDelta.strip() != '':
|
||||||
currNegativeDelta = currNegativeDelta.strip()
|
currNegativeDelta = currNegativeDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import char_utils
|
from fenrirscreenreader.utils import char_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
# detect an change on the screen, we just want to cursor arround, so no change should appear
|
# detect an change on the screen, we just want to cursor arround, so no change should appear
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isNegativeDelta():
|
if self.env['runtime']['screenManager'].isNegativeDelta():
|
||||||
return
|
return
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# is it a horizontal change?
|
# is it a horizontal change?
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
|
|
||||||
# echo word insteed of char
|
# echo word insteed of char
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||||
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
if self.env['screen']['newCursor']['x'] == x:
|
if self.env['screen']['newCursor']['x'] == x:
|
||||||
return
|
return
|
||||||
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if not currChar.isspace():
|
if not currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# try to detect the tab completion by cursor change
|
# try to detect the tab completion by cursor change
|
||||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
if xMove == 1:
|
if xMove == 1:
|
||||||
return
|
return
|
||||||
# is there any change?
|
# is there any change?
|
||||||
if not self.env['runtime']['screenManager'].isDelta():
|
if not self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])):
|
if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])):
|
||||||
return
|
return
|
||||||
# detect deletion or chilling
|
# detect deletion or chilling
|
||||||
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
|
|
||||||
# filter unneded space on word begin
|
# filter unneded space on word begin
|
||||||
currDelta = self.env['screen']['newDelta']
|
currDelta = self.env['screen']['newDelta']
|
||||||
if len(currDelta.strip()) != len(currDelta) and \
|
if len(currDelta.strip()) != len(currDelta) and \
|
||||||
currDelta.strip() != '':
|
currDelta.strip() != '':
|
||||||
currDelta = currDelta.strip()
|
currDelta = currDelta.strip()
|
||||||
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# is navigation?
|
# is navigation?
|
||||||
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
# just when cursor move worddetection is needed
|
# just when cursor move worddetection is needed
|
||||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||||
return
|
return
|
||||||
# for now no new line
|
# for now no new line
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
# currently writing
|
# currently writing
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
return
|
||||||
|
|
||||||
# get the word
|
# get the word
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
x, y, currWord, endOfScreen, lineBreak = \
|
x, y, currWord, endOfScreen, lineBreak = \
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||||
|
|
||||||
# is there a word?
|
# is there a word?
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
|
|
||||||
# at the start of a word
|
# at the start of a word
|
||||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||||
(self.env['screen']['newCursor']['x'] != x):
|
(self.env['screen']['newCursor']['x'] != x):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import line_utils
|
from fenrirscreenreader.utils import line_utils
|
||||||
from fenrirscreenreader.utils import word_utils
|
from fenrirscreenreader.utils import word_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.lastIdent = -1
|
self.lastIdent = -1
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
self.lastIdent = 0
|
self.lastIdent = 0
|
||||||
return
|
return
|
||||||
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
||||||
if self.env['runtime']['screenManager'].isDelta():
|
if self.env['runtime']['screenManager'].isDelta():
|
||||||
return
|
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
|
||||||
|
|
||||||
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||||
if currLine.isspace():
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
# ident
|
# ident
|
||||||
currIdent = len(currLine) - len(currLine.lstrip())
|
currIdent = len(currLine) - len(currLine.lstrip())
|
||||||
if self.lastIdent == -1:
|
if self.lastIdent == -1:
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
doInterrupt = True
|
doInterrupt = True
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
|
||||||
if self.lastIdent != currIdent:
|
if self.lastIdent != currIdent:
|
||||||
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
|
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
|
||||||
doInterrupt = False
|
doInterrupt = False
|
||||||
# barrier
|
# barrier
|
||||||
sayLine = currLine
|
sayLine = currLine
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
||||||
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
||||||
if isBarrier:
|
if isBarrier:
|
||||||
sayLine = barrierLine
|
sayLine = barrierLine
|
||||||
# output
|
# output
|
||||||
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
||||||
self.lastIdent = currIdent
|
self.lastIdent = currIdent
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
from fenrirscreenreader.utils import screen_utils
|
from fenrirscreenreader.utils import screen_utils
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('Reads attributes of current cursor position')
|
return _('Reads attributes of current cursor position')
|
||||||
def run(self):
|
def run(self):
|
||||||
# is it enabled?
|
# is it enabled?
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
|
||||||
return
|
return
|
||||||
# is a vertical change?
|
# is a vertical change?
|
||||||
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
|
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
|
||||||
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
|
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
|
||||||
return
|
return
|
||||||
|
|
||||||
cursorPos = self.env['screen']['newCursor']
|
cursorPos = self.env['screen']['newCursor']
|
||||||
|
|
||||||
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
|
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
|
||||||
return
|
return
|
||||||
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
|
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('exits review mode')
|
return _('exits review mode')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['cursorManager'].isReviewMode():
|
if self.env['runtime']['cursorManager'].isReviewMode():
|
||||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import time
|
import time
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.lastTime = datetime.datetime.now()
|
self.lastTime = datetime.datetime.now()
|
||||||
self.lastDateString = ''
|
self.lastDateString = ''
|
||||||
self.lastTimeString = ''
|
self.lastTimeString = ''
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['screenDriver'].getSessionInformation()
|
self.env['runtime']['screenDriver'].getSessionInformation()
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,85 +1,85 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.lastTime = datetime.datetime.now()
|
self.lastTime = datetime.datetime.now()
|
||||||
self.lastDateString = ''
|
self.lastDateString = ''
|
||||||
self.lastTimeString = ''
|
self.lastTimeString = ''
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
|
||||||
return
|
return
|
||||||
|
|
||||||
onMinutes = self.env['runtime']['settingsManager'].getSetting('time', 'onMinutes')
|
onMinutes = self.env['runtime']['settingsManager'].getSetting('time', 'onMinutes')
|
||||||
delaySec = self.env['runtime']['settingsManager'].getSettingAsInt('time', 'delaySec')
|
delaySec = self.env['runtime']['settingsManager'].getSettingAsInt('time', 'delaySec')
|
||||||
|
|
||||||
# no need
|
# no need
|
||||||
if onMinutes == '' and delaySec <= 0:
|
if onMinutes == '' and delaySec <= 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
onMinutes = onMinutes.split(',')
|
onMinutes = onMinutes.split(',')
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|
||||||
# ignore onMinutes if there is a delaySec
|
# ignore onMinutes if there is a delaySec
|
||||||
if delaySec > 0:
|
if delaySec > 0:
|
||||||
if int((now - self.lastTime).total_seconds()) < delaySec:
|
if int((now - self.lastTime).total_seconds()) < delaySec:
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# should announce?
|
# should announce?
|
||||||
if not str(now.minute).zfill(2) in onMinutes:
|
if not str(now.minute).zfill(2) in onMinutes:
|
||||||
return
|
return
|
||||||
# already announced?
|
# already announced?
|
||||||
if now.hour == self.lastTime.hour:
|
if now.hour == self.lastTime.hour:
|
||||||
if now.minute == self.lastTime.minute:
|
if now.minute == self.lastTime.minute:
|
||||||
return
|
return
|
||||||
|
|
||||||
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
||||||
dateString = datetime.datetime.strftime(now, dateFormat)
|
dateString = datetime.datetime.strftime(now, dateFormat)
|
||||||
|
|
||||||
presentDate = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate') and \
|
presentDate = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate') and \
|
||||||
self.lastDateString != dateString
|
self.lastDateString != dateString
|
||||||
presentTime = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime')
|
presentTime = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime')
|
||||||
|
|
||||||
# no changed value to announce
|
# no changed value to announce
|
||||||
if not (presentDate or presentTime):
|
if not (presentDate or presentTime):
|
||||||
return
|
return
|
||||||
|
|
||||||
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
|
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
|
||||||
timeString = datetime.datetime.strftime(now, timeFormat)
|
timeString = datetime.datetime.strftime(now, timeFormat)
|
||||||
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'interrupt'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'interrupt'):
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'announce'):
|
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'announce'):
|
||||||
self.env['runtime']['outputManager'].playSoundIcon('announce')
|
self.env['runtime']['outputManager'].playSoundIcon('announce')
|
||||||
|
|
||||||
if presentTime:
|
if presentTime:
|
||||||
# present the time
|
# present the time
|
||||||
self.env['runtime']['outputManager'].presentText(_("It's {0}").format(timeString.replace(':00', " O'clock ").lstrip('0')), soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(_("It's {0}").format(timeString.replace(':00', " O'clock ").lstrip('0')), soundIcon='', interrupt=False)
|
||||||
# Check if it's 12:00 AM
|
# Check if it's 12:00 AM
|
||||||
if now.hour == 0 and now.minute == 0:
|
if now.hour == 0 and now.minute == 0:
|
||||||
# present the date
|
# present the date
|
||||||
self.env['runtime']['outputManager'].presentText(dateString, soundIcon='', interrupt=False)
|
self.env['runtime']['outputManager'].presentText(dateString, soundIcon='', interrupt=False)
|
||||||
|
|
||||||
self.lastTime = datetime.datetime.now()
|
self.lastTime = datetime.datetime.now()
|
||||||
self.lastTimeString = timeString
|
self.lastTimeString = timeString
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import time
|
import time
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
print(time.time())
|
print(time.time())
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
if len(self.env['input']['currInput']) <= len(self.env['input']['prevInput']):
|
if len(self.env['input']['currInput']) <= len(self.env['input']['prevInput']):
|
||||||
return
|
return
|
||||||
# if the filter is set
|
# if the filter is set
|
||||||
if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
|
if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
|
||||||
filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
|
filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
|
||||||
for currInput in self.env['input']['currInput']:
|
for currInput in self.env['input']['currInput']:
|
||||||
if not currInput in filterList:
|
if not currInput in filterList:
|
||||||
return
|
return
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('disables speech until next keypress')
|
return _('disables speech until next keypress')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||||
return
|
return
|
||||||
if len(self.env['input']['prevInput']) >0:
|
if len(self.env['input']['prevInput']) >0:
|
||||||
return
|
return
|
||||||
if not self.env['commandBuffer']['enableSpeechOnKeypress']:
|
if not self.env['commandBuffer']['enableSpeechOnKeypress']:
|
||||||
return
|
return
|
||||||
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
|
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
|
||||||
self.env['commandBuffer']['enableSpeechOnKeypress'] = False
|
self.env['commandBuffer']['enableSpeechOnKeypress'] = False
|
||||||
self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']:
|
if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']:
|
||||||
return
|
return
|
||||||
if self.env['input']['newCapsLock']:
|
if self.env['input']['newCapsLock']:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']:
|
if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']:
|
||||||
return
|
return
|
||||||
if self.env['input']['newScrollLock']:
|
if self.env['input']['newScrollLock']:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']:
|
if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']:
|
||||||
return
|
return
|
||||||
if self.env['input']['newNumLock']:
|
if self.env['input']['newNumLock']:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True)
|
self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['runtime']['helpManager'].isTutorialMode():
|
if self.env['runtime']['helpManager'].isTutorialMode():
|
||||||
self.env['runtime']['inputManager'].keyEcho()
|
self.env['runtime']['inputManager'].keyEcho()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.lastTime = time.time()
|
self.lastTime = time.time()
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No description found'
|
return 'No description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
playSound = False
|
playSound = False
|
||||||
deviceList = self.env['runtime']['inputManager'].getLastDetectedDevices()
|
deviceList = self.env['runtime']['inputManager'].getLastDetectedDevices()
|
||||||
try:
|
try:
|
||||||
for deviceEntry in deviceList:
|
for deviceEntry in deviceList:
|
||||||
# dont play sounds for virtual devices
|
# dont play sounds for virtual devices
|
||||||
playSound = playSound or not deviceEntry['virtual']
|
playSound = playSound or not deviceEntry['virtual']
|
||||||
except:
|
except:
|
||||||
playSound = True
|
playSound = True
|
||||||
if playSound:
|
if playSound:
|
||||||
if time.time() - self.lastTime > 5:
|
if time.time() - self.lastTime > 5:
|
||||||
self.env['runtime']['outputManager'].playSoundIcon(soundIcon = 'accept', interrupt=True)
|
self.env['runtime']['outputManager'].playSoundIcon(soundIcon = 'accept', interrupt=True)
|
||||||
lastTime = time.time()
|
lastTime = time.time()
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
self.env['runtime']['outputManager'].interruptOutput()
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.env['runtime']['outputManager'].presentText(_("screen {0}").format(self.env['screen']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("screen {0}").format(self.env['screen']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False)
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'], interrupt=False, flush=False)
|
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'], interrupt=False, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return _('enables or disables tracking of highlighted')
|
return _('enables or disables tracking of highlighted')
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
|
||||||
return
|
return
|
||||||
attributeDelta = self.env['runtime']['attributeManager'].getAttributeDelta()
|
attributeDelta = self.env['runtime']['attributeManager'].getAttributeDelta()
|
||||||
self.env['runtime']['outputManager'].presentText(attributeDelta, soundIcon='', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(attributeDelta, soundIcon='', interrupt=True, flush=False)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,67 +1,67 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return ''
|
return ''
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['screen']['newAttribDelta'] != '':
|
if self.env['screen']['newAttribDelta'] != '':
|
||||||
return
|
return
|
||||||
if self.env['runtime']['screenManager'].isScreenChange():
|
if self.env['runtime']['screenManager'].isScreenChange():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||||
return
|
return
|
||||||
if self.env['runtime']['attributeManager'].isAttributeChange():
|
if self.env['runtime']['attributeManager'].isAttributeChange():
|
||||||
return
|
return
|
||||||
# hack for pdmenu and maybe other dialog apps that place the cursor at last cell/row
|
# hack for pdmenu and maybe other dialog apps that place the cursor at last cell/row
|
||||||
# this is not to be identified as history
|
# this is not to be identified as history
|
||||||
if (self.env['screen']['newCursor']['x'] == self.env['runtime']['screenManager'].getColumns() - 1) and (self.env['screen']['newCursor']['y'] == self.env['runtime']['screenManager'].getRows() - 1):
|
if (self.env['screen']['newCursor']['x'] == self.env['runtime']['screenManager'].getColumns() - 1) and (self.env['screen']['newCursor']['y'] == self.env['runtime']['screenManager'].getRows() - 1):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
|
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
|
||||||
if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_UP'],['KEY_DOWN']]):
|
if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_UP'],['KEY_DOWN']]):
|
||||||
return
|
return
|
||||||
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
|
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
|
||||||
if not (self.env['runtime']['byteManager'].getLastByteKey() in [b'^[[A',b'^[[B']):
|
if not (self.env['runtime']['byteManager'].getLastByteKey() in [b'^[[A',b'^[[B']):
|
||||||
return
|
return
|
||||||
|
|
||||||
prevLine = self.env['screen']['oldContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
prevLine = self.env['screen']['oldContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
currLine = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
currLine = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||||
if prevLine == currLine:
|
if prevLine == currLine:
|
||||||
if self.env['screen']['newDelta'] != '':
|
if self.env['screen']['newDelta'] != '':
|
||||||
return
|
return
|
||||||
if not currLine.isspace():
|
if not currLine.isspace():
|
||||||
currPrompt = currLine.find('$')
|
currPrompt = currLine.find('$')
|
||||||
rootPrompt = currLine.find('#')
|
rootPrompt = currLine.find('#')
|
||||||
if currPrompt <= 0:
|
if currPrompt <= 0:
|
||||||
if rootPrompt > 0:
|
if rootPrompt > 0:
|
||||||
currPrompt = rootPrompt
|
currPrompt = rootPrompt
|
||||||
else:
|
else:
|
||||||
announce = currLine
|
announce = currLine
|
||||||
if currPrompt > 0:
|
if currPrompt > 0:
|
||||||
remove_digits = str.maketrans('0123456789', ' ')
|
remove_digits = str.maketrans('0123456789', ' ')
|
||||||
if prevLine[:currPrompt].translate(remove_digits) == currLine[:currPrompt].translate(remove_digits):
|
if prevLine[:currPrompt].translate(remove_digits) == currLine[:currPrompt].translate(remove_digits):
|
||||||
announce = currLine[currPrompt+1:]
|
announce = currLine[currPrompt+1:]
|
||||||
else:
|
else:
|
||||||
announce = currLine
|
announce = currLine
|
||||||
|
|
||||||
if currLine.isspace():
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False)
|
self.env['runtime']['outputManager'].presentText(announce, interrupt=True, flush=False)
|
||||||
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True
|
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True
|
||||||
self.env['commandsIgnore']['onScreenUpdate']['CHAR_ECHO'] = True
|
self.env['commandsIgnore']['onScreenUpdate']['CHAR_ECHO'] = True
|
||||||
self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True
|
self.env['commandsIgnore']['onScreenUpdate']['INCOMING_IGNORE'] = True
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -1,39 +1,39 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
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 not self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
if not self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
|
||||||
return
|
return
|
||||||
|
|
||||||
# this must be a keyecho or something
|
# this must be a keyecho or something
|
||||||
#if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
|
#if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
|
||||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||||
yMove = abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y'])
|
yMove = abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y'])
|
||||||
|
|
||||||
if (xMove >= 1) and xMove == len(self.env['screen']['newDelta']):
|
if (xMove >= 1) and xMove == len(self.env['screen']['newDelta']):
|
||||||
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||||
if not '\n' in self.env['screen']['newDelta']:
|
if not '\n' in self.env['screen']['newDelta']:
|
||||||
return
|
return
|
||||||
#print(xMove, yMove, len(self.env['screen']['newDelta']), len(self.env['screen']['newNegativeDelta']))
|
#print(xMove, yMove, len(self.env['screen']['newDelta']), len(self.env['screen']['newNegativeDelta']))
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import time
|
import time
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
|
|
||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
pass
|
pass
|
||||||
def getDescription(self):
|
def getDescription(self):
|
||||||
return 'No Description found'
|
return 'No Description found'
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('promote', 'enabled'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('promote', 'enabled'):
|
||||||
return
|
return
|
||||||
if self.env['runtime']['settingsManager'].getSetting('promote', 'list').strip(" \t\n") == '':
|
if self.env['runtime']['settingsManager'].getSetting('promote', 'list').strip(" \t\n") == '':
|
||||||
return
|
return
|
||||||
if int(time.time() - self.env['input']['lastInputTime']) < self.env['runtime']['settingsManager'].getSettingAsInt('promote', 'inactiveTimeoutSec'):
|
if int(time.time() - self.env['input']['lastInputTime']) < self.env['runtime']['settingsManager'].getSettingAsInt('promote', 'inactiveTimeoutSec'):
|
||||||
return
|
return
|
||||||
if len(self.env['runtime']['settingsManager'].getSetting('promote', 'list')) == 0:
|
if len(self.env['runtime']['settingsManager'].getSetting('promote', 'list')) == 0:
|
||||||
return
|
return
|
||||||
for promote in self.env['runtime']['settingsManager'].getSetting('promote', 'list').split(','):
|
for promote in self.env['runtime']['settingsManager'].getSetting('promote', 'list').split(','):
|
||||||
if promote in self.env['screen']['newDelta']:
|
if promote in self.env['screen']['newDelta']:
|
||||||
self.env['runtime']['outputManager'].playSoundIcon('PromotedText')
|
self.env['runtime']['outputManager'].playSoundIcon('PromotedText')
|
||||||
self.env['input']['lastInputTime'] = time.time()
|
self.env['input']['lastInputTime'] = time.time()
|
||||||
return
|
return
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user