diff --git a/src/fenrir/commands/commands/attribute_cursor.py b/src/fenrir/commands/commands/attribute_cursor.py new file mode 100644 index 00000000..a843e4c0 --- /dev/null +++ b/src/fenrir/commands/commands/attribute_cursor.py @@ -0,0 +1,25 @@ +#!/bin/python +# -*- coding: utf-8 -*- + +# Fenrir TTY screen reader +# By Chrys, Storm Dragon, and contributers. + +from core import debug + +class command(): + def __init__(self): + pass + def initialize(self, environment): + self.env = environment + def shutdown(self): + pass + def getDescription(self): + return 'No description found' + def run(self): + cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() + attributes = self.env['screen']['newContentAttrib'][cursorPos['x']][cursorPos['y']] + attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString') + attributeFormatString = self.env['runtime']['screenManager'].formatAttributes(attributeFormatString) + self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True) + def setCallback(self, callback): + pass diff --git a/src/fenrir/core/screenManager.py b/src/fenrir/core/screenManager.py index fd6f8e8e..4f0d9c68 100644 --- a/src/fenrir/core/screenManager.py +++ b/src/fenrir/core/screenManager.py @@ -35,7 +35,7 @@ class screenManager(): # or len(self.env['screen']['newDelta']) > 6: # self.env['runtime']['screenDriver'].getCurrApplication() self.env['screen']['lastScreenUpdate'] = time.time() - def formatAttributes(self, x, y,attribute, attributeFormatString = None): + def formatAttributes(self, attribute, attributeFormatString = None): if not attributeFormatString: attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString') if not attributeFormatString: