From 8d500f14706b84f854c6aaf7595b2e39f264bae1 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 5 Oct 2016 23:28:52 +0200 Subject: [PATCH] fix clipboard --- config/keyboard/test.conf | 60 ++++++++++++++----- config/settings/settings.conf | 8 +-- .../commands/linux_paste_clipboard.py | 2 +- src/fenrir/commands/onInput/72000-history.py | 4 +- 4 files changed, 50 insertions(+), 24 deletions(-) diff --git a/config/keyboard/test.conf b/config/keyboard/test.conf index 953104af..d5fe4d40 100644 --- a/config/keyboard/test.conf +++ b/config/keyboard/test.conf @@ -5,37 +5,65 @@ KEY_FENRIR,KEY_KP7=review_top KEY_KP8=review_curr_line KEY_KP7=review_prev_line KEY_KP9=review_next_line -#KEY_FENRIR,KEY_KP6=review_line_end -#KEY_FENRIR,KEY_KP5=review_line_begin -#KEY_FENRIR,KEY_KP6=review_line_last_char +KEY_FENRIR,KEY_KP4=review_line_begin +KEY_FENRIR,KEY_KP6=review_line_end 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 -2,KEY_KP5=curr_word_phonetic +KEY_SHIFT,KEY_KP5=curr_word_phonetic KEY_KP2=review_curr_char KEY_KP1=review_prev_char KEY_KP3=review_next_char -2,KEY_KP2=curr_char_phonetic -KEY_FENRIR,KEY_KP5=review_up -KEY_FENRIR,KEY_KP6=review_down +KEY_SHIFT,KEY_KP2=curr_char_phonetic +#=review_up +#=review_down KEY_KPDOT=cursor_position KEY_FENRIR,KEY_I=indent_curr_line KEY_FENRIR,KEY_KPDOT=exit_review -#KEY_FENRIR,KEY_KP5=curr_screen +KEY_FENRIR,KEY_KP5=curr_screen KEY_FENRIR,KEY_KP8=curr_screen_before_cursor KEY_FENRIR,KEY_KP2=curr_screen_after_cursor -KEY_FENRIR,KEY_1=set_window_application -KEY_FENRIR,KEY_3=clear_window_application -#KEY_FENRIR,KEY_3=clear_bookmark_1 -#KEY_FENRIR,KEY_1=set_bookmark_1 -KEY_FENRIR,KEY_2=bookmark_1 +KEY_FENRIR,KEY_CTRL,KEY_1=clear_bookmark_1 +KEY_FENRIR,KEY_SHIFT,KEY_1=set_bookmark_1 +KEY_FENRIR,KEY_1=bookmark_1 +KEY_FENRIR,KEY_CTRL,KEY_2=clear_bookmark_2 +KEY_FENRIR,KEY_SHIFT,KEY_2=set_bookmark_2 +KEY_FENRIR,KEY_2=bookmark_2 +KEY_FENRIR,KEY_CTRL,KEY_3=clear_bookmark_3 +KEY_FENRIR,KEY_SHIFT,KEY_3=set_bookmark_3 +KEY_FENRIR,KEY_3=bookmark_3 +KEY_FENRIR,KEY_CTRL,KEY_4=clear_bookmark_4 +KEY_FENRIR,KEY_SHIFT,KEY_4=set_bookmark_4 +KEY_FENRIR,KEY_4=bookmark_4 +KEY_FENRIR,KEY_CTRL,KEY_5=clear_bookmark_5 +KEY_FENRIR,KEY_SHIFT,KEY_5=set_bookmark_5 +KEY_FENRIR,KEY_5=bookmark_5 +KEY_FENRIR,KEY_CTRL,KEY_6=clear_bookmark_6 +KEY_FENRIR,KEY_SHIFT,KEY_6=set_bookmark_6 +KEY_FENRIR,KEY_6=bookmark_6 +KEY_FENRIR,KEY_CTRL,KEY_7=clear_bookmark_7 +KEY_FENRIR,KEY_SHIFT,KEY_7=set_bookmark_7 +KEY_FENRIR,KEY_7=bookmark_7 +KEY_FENRIR,KEY_CTRL,KEY_8=clear_bookmark_8 +KEY_FENRIR,KEY_SHIFT,KEY_8=set_bookmark_8 +KEY_FENRIR,KEY_8=bookmark_8 +KEY_FENRIR,KEY_CTRL,KEY_9=clear_bookmark_9 +KEY_FENRIR,KEY_SHIFT,KEY_9=set_bookmark_9 +KEY_FENRIR,KEY_9=bookmark_9 +KEY_FENRIR,KEY_CTRL,KEY_0=clear_bookmark_10 +KEY_FENRIR,KEY_SHIFT,KEY_0=set_bookmark_10 +KEY_FENRIR,KEY_0=bookmark_10 +KEY_FENRIR,KEY_KPSLASH=set_window_application +2,KEY_FENRIR,KEY_KPSLASH=clear_window_application KEY_KPPLUS=last_incoming KEY_FENRIR,KEY_F2=toggle_braille KEY_FENRIR,KEY_F3=toggle_sound KEY_FENRIR,KEY_F4=toggle_speech -KEY_FENRIR,KEY_F5=toggle_punctuation_level +KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check KEY_FENRIR,KEY_BACKSLASH=toggle_output key_FENRIR,KEY_KPENTER=toggle_auto_read @@ -54,8 +82,8 @@ KEY_FENRIR,KEY_ALT,KEY_RIGHT=inc_speech_pitch KEY_FENRIR,KEY_ALT,KEY_LEFT=dec_speech_pitch KEY_FENRIR,KEY_ALT,KEY_UP=inc_sound_volume KEY_FENRIR,KEY_ALT,KEY_DOWN=dec_sound_volume -KEY_FENRIR,KEY_SHIFT,KEY_C=clear_clipboard -KEY_FENRIR,KEY_SHIFT,KEY_X=remove_marks +KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_C=clear_clipboard +KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_X=remove_marks KEY_FENRIR,KEY_HOME=first_clipboard KEY_FENRIR,KEY_END=last_clipboard KEY_FENRIR,KEY_PAGEUP=prev_clipboard diff --git a/config/settings/settings.conf b/config/settings/settings.conf index ce851095..65c83fd0 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -57,7 +57,7 @@ module=espeak voice= # Select the language you want fenrir to use. -language=de +language=english-us # Read new text as it happens? autoReadIncoming=True @@ -82,7 +82,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 @@ -95,8 +95,8 @@ interruptOnKeyPress=False doubleTapDelay=0.2 [general] -debugLevel=0 -punctuationLevel=Some +debugLevel=3 +punctuationLevel=some numberOfClipboards=10 # define the current fenrir key fenrirKeys=KEY_KP0,KEY_META diff --git a/src/fenrir/commands/commands/linux_paste_clipboard.py b/src/fenrir/commands/commands/linux_paste_clipboard.py index ebbb4768..5f4a376f 100644 --- a/src/fenrir/commands/commands/linux_paste_clipboard.py +++ b/src/fenrir/commands/commands/linux_paste_clipboard.py @@ -27,7 +27,7 @@ class command(): if not self.env['commandBuffer']['clipboard']: self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) return - if self.env['commandBuffer']['clipboard'][currClipboard]: + if not self.env['commandBuffer']['clipboard'][currClipboard]: self.env['runtime']['outputManager'].presentText('clipboard empty', interrupt=True) return if self.env['commandBuffer']['clipboard'][currClipboard] == '': diff --git a/src/fenrir/commands/onInput/72000-history.py b/src/fenrir/commands/onInput/72000-history.py index db93768a..8ac8cae8 100644 --- a/src/fenrir/commands/onInput/72000-history.py +++ b/src/fenrir/commands/onInput/72000-history.py @@ -29,8 +29,6 @@ class command(): return prevLine = self.env['screenData']['oldContentText'].split('\n')[self.env['screenData']['newCursor']['y']] currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']] - #if prevLine == currLine: - # return if currLine.isspace(): self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) else: @@ -47,7 +45,7 @@ class command(): announce = currLine[currPrompt+1:] else: announce = currLine - print(announce) + if currLine.isspace(): self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) else: