diff --git a/config/keyboard/test.conf b/config/keyboard/test.conf index 4356e272..1740b98e 100644 --- a/config/keyboard/test.conf +++ b/config/keyboard/test.conf @@ -11,18 +11,18 @@ KEY_FENRIR,KEY_KP1=review_line_first_char KEY_FENRIR,KEY_KP3=review_line_last_char KEY_FENRIR,KEY_ALT,KEY_1=present_first_line KEY_FENRIR,KEY_ALT,KEY_2=present_last_line -KEY_KP5=review_curr_word -KEY_KP4=review_prev_word -KEY_KP6=review_next_word -KEY_SHIFT,KEY_KP5=curr_word_phonetic -KEY_SHIFT,KEY_KP4=review_prev_word_phonetic -KEY_SHIFT,KEY_KP6=review_next_word_phonetic +#KEY_KP5=review_curr_word +#KEY_KP4=review_prev_word +#KEY_KP6=review_next_word +KEY_KP5=review_curr_word_phonetic +KEY_KP4=review_prev_word_phonetic +KEY_KP6=review_next_word_phonetic #KEY_KP2=review_curr_char #KEY_KP1=review_prev_char #KEY_KP3=review_next_char -KEY_KP2=review_curr_char_phonetic -KEY_KP1=review_prev_char_phonetic -KEY_KP3=review_next_char_phonetic +#KEY_KP2=review_curr_char_phonetic +#KEY_KP1=review_prev_char_phonetic +#KEY_KP3=review_next_char_phonetic #=review_up #=review_down KEY_KPDOT=cursor_position @@ -75,9 +75,8 @@ key_FENRIR,KEY_KPENTER=toggle_auto_read KEY_FENRIR,KEY_Q=quit_fenrir KEY_FENRIR,KEY_T=time 2,KEY_FENRIR,KEY_T=date -KEY_FENRIR,KEY_S=spell_check -2,KEY_FENRIR,KEY_S=add_word_to_spell_check -KEY_FENRIR,KEY_SHIFT,KEY_S=remove_word_from_spell_check +KEY_KP1=add_word_to_spell_check +KEY_KP2=remove_word_from_spell_check KEY_FENRIR,KEY_BACKSPACE=forward_keypress KEY_FENRIR,KEY_UP=inc_speech_volume KEY_FENRIR,KEY_DOWN=dec_speech_volume diff --git a/config/settings/settings.conf b/config/settings/settings.conf index ff6b691c..cd44ed61 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -57,14 +57,14 @@ module=espeak voice= # Select the language you want fenrir to use. -language=de +language=english-us # Read new text as it happens? autoReadIncoming=True [braille] #braille is not implemented yet -enabled=True +enabled=False driver=brlapi layout=en @@ -83,7 +83,7 @@ device=AUTO grabDevices=True ignoreShortcuts=False # the current shortcut layout located in /etc/fenrir/keyboard -keyboardLayout=test +keyboardLayout=desktop # echo chars while typing. charEcho=False # echo deleted chars @@ -96,9 +96,9 @@ interruptOnKeyPress=False doubleTapTimeout=0.2 [general] -debugLevel=1 +debugLevel=0 punctuationProfile=default -punctuationLevel=Some +punctuationLevel=some numberOfClipboards=10 emoticons=True # define the current fenrir key diff --git a/src/fenrir/commands/commands/add_word_to_spell_check.py b/src/fenrir/commands/commands/add_word_to_spell_check.py index ce334347..06a0b186 100644 --- a/src/fenrir/commands/commands/add_word_to_spell_check.py +++ b/src/fenrir/commands/commands/add_word_to_spell_check.py @@ -6,6 +6,7 @@ from core import debug from utils import word_utils +import string initialized = False try: import enchant @@ -35,14 +36,13 @@ class command(): if self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage') != self.language: try: self.updateSpellLanguage() - except: + except Exception as e: return - cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() - # get the word newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']] - x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent) + x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent) + currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=§>?@[\\]^_{|}~') if currWord != '': if self.spellChecker.is_added(currWord): diff --git a/src/fenrir/commands/commands/remove_word_from_spell_check.py b/src/fenrir/commands/commands/remove_word_from_spell_check.py index 6758ef26..6799b516 100644 --- a/src/fenrir/commands/commands/remove_word_from_spell_check.py +++ b/src/fenrir/commands/commands/remove_word_from_spell_check.py @@ -6,6 +6,7 @@ from core import debug from utils import word_utils +import string initialized = False try: import enchant @@ -43,13 +44,12 @@ class command(): # get the word newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']] x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent) - + currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=§>?@[\\]^_{|}~') if not currWord.isspace(): if self.spellChecker.is_removed(currWord): self.env['runtime']['outputManager'].presentText(currWord + ' is already removed from dict',soundIcon='Cancel', interrupt=True) else: self.spellChecker.remove(currWord) self.env['runtime']['outputManager'].presentText(currWord + ' removed',soundIcon='Accept', interrupt=True) - def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_curr_word_phonetic.py b/src/fenrir/commands/commands/review_curr_word_phonetic.py index 6b5865cd..edf6bc07 100644 --- a/src/fenrir/commands/commands/review_curr_word_phonetic.py +++ b/src/fenrir/commands/commands/review_curr_word_phonetic.py @@ -16,11 +16,11 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'phonetically spells the current word' + return 'phonetically spells the current word and set review to it' def run(self): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() - x, y, currWord = \ + self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \ word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) if currWord.isspace(): @@ -29,7 +29,7 @@ class command(): firstSequence = True for c in currWord: currChar = char_utils.getPhonetic(c) - self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence) + self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True) firstSequence = False def setCallback(self, callback): diff --git a/src/fenrir/commands/onInput/62000-spell_check.py b/src/fenrir/commands/onInput/62000-spell_check.py index 40a2f84d..cf0d773a 100644 --- a/src/fenrir/commands/onInput/62000-spell_check.py +++ b/src/fenrir/commands/onInput/62000-spell_check.py @@ -127,3 +127,4 @@ class command(): def setCallback(self, callback): pass + diff --git a/src/fenrir/core/punctuationManager.py b/src/fenrir/core/punctuationManager.py index 1b3ad8d8..eca809b6 100644 --- a/src/fenrir/core/punctuationManager.py +++ b/src/fenrir/core/punctuationManager.py @@ -12,7 +12,7 @@ class punctuationManager(): pass def initialize(self, environment): self.env = environment - self.allPunctNone = dict.fromkeys(map(ord, string.punctuation), ' ') + self.allPunctNone = dict.fromkeys(map(ord, string.punctuation +"§"), ' ') # replace with space: # dot, comma, grave, apostrophe for char in [ord('.'),ord(','),ord('`'),ord("'")]: