Character echo settings toggle key added. Keyboard files updated.
This commit is contained in:
@@ -83,6 +83,7 @@ KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
|||||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||||
KEY_FENRIR,KEY_CTRL,KEY_E=toggle_emoticons
|
KEY_FENRIR,KEY_CTRL,KEY_E=toggle_emoticons
|
||||||
|
KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_E=cycle_key_echo
|
||||||
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
||||||
KEY_FENRIR,KEY_CTRL,KEY_T=toggle_auto_time
|
KEY_FENRIR,KEY_CTRL,KEY_T=toggle_auto_time
|
||||||
KEY_FENRIR,KEY_KPASTERISK=toggle_highlight_tracking
|
KEY_FENRIR,KEY_KPASTERISK=toggle_highlight_tracking
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level
|
|||||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||||
KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_ENTER=toggle_output
|
KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_ENTER=toggle_output
|
||||||
KEY_FENRIR,KEY_SHIFT,KEY_E=toggle_emoticons
|
KEY_FENRIR,KEY_SHIFT,KEY_E=toggle_emoticons
|
||||||
|
KEY_FENRIR,KEY_CTRL,KEY_SHIFT,KEY_E=cycle_key_echo
|
||||||
KEY_FENRIR,KEY_CTRL,KEY_T=toggle_auto_time
|
KEY_FENRIR,KEY_CTRL,KEY_T=toggle_auto_time
|
||||||
KEY_FENRIR,KEY_Y=toggle_highlight_tracking
|
KEY_FENRIR,KEY_Y=toggle_highlight_tracking
|
||||||
#=toggle_barrier
|
#=toggle_barrier
|
||||||
|
|||||||
57
src/fenrirscreenreader/commands/commands/cycle_key_echo.py
Normal file
57
src/fenrirscreenreader/commands/commands/cycle_key_echo.py
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Fenrir TTY screen reader
|
||||||
|
# By Chrys, Storm Dragon, and contributors.
|
||||||
|
|
||||||
|
|
||||||
|
from fenrirscreenreader.core.i18n import _
|
||||||
|
|
||||||
|
|
||||||
|
class command:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def initialize(self, environment):
|
||||||
|
self.env = environment
|
||||||
|
|
||||||
|
def shutdown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
return _("Cycle through key echo modes: character, word, off")
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
settings_manager = self.env["runtime"]["SettingsManager"]
|
||||||
|
output_manager = self.env["runtime"]["OutputManager"]
|
||||||
|
|
||||||
|
# Get current settings
|
||||||
|
char_echo_mode = settings_manager.get_setting("keyboard", "char_echo_mode")
|
||||||
|
word_echo = settings_manager.get_setting_as_bool("keyboard", "word_echo")
|
||||||
|
|
||||||
|
# Determine current state and cycle to next
|
||||||
|
# States: character (char=1, word=False) -> word (char=0, word=True) -> off (char=0, word=False)
|
||||||
|
if char_echo_mode == "1" and not word_echo:
|
||||||
|
# Currently character echo, switch to word echo
|
||||||
|
settings_manager.set_setting("keyboard", "char_echo_mode", "0")
|
||||||
|
settings_manager.set_setting("keyboard", "word_echo", "True")
|
||||||
|
output_manager.present_text(
|
||||||
|
_("Key echo word"), sound_icon="Accept", interrupt=True
|
||||||
|
)
|
||||||
|
elif word_echo:
|
||||||
|
# Currently word echo, switch to off
|
||||||
|
settings_manager.set_setting("keyboard", "char_echo_mode", "0")
|
||||||
|
settings_manager.set_setting("keyboard", "word_echo", "False")
|
||||||
|
output_manager.present_text(
|
||||||
|
_("Key echo off"), sound_icon="Accept", interrupt=True
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# Currently off (or caps mode), switch to character echo
|
||||||
|
settings_manager.set_setting("keyboard", "char_echo_mode", "1")
|
||||||
|
settings_manager.set_setting("keyboard", "word_echo", "False")
|
||||||
|
output_manager.present_text(
|
||||||
|
_("Key echo character"), sound_icon="Accept", interrupt=True
|
||||||
|
)
|
||||||
|
|
||||||
|
def set_callback(self, callback):
|
||||||
|
pass
|
||||||
@@ -305,12 +305,12 @@ class command:
|
|||||||
self.env["commandBuffer"]["lastProgressTime"] = current_time
|
self.env["commandBuffer"]["lastProgressTime"] = current_time
|
||||||
return
|
return
|
||||||
|
|
||||||
# Pattern 6: Claude Code working indicators (various symbols + activity text + "esc to interrupt")
|
# Pattern 6: Claude Code working indicators (various symbols + activity text + "esc/ctrl+c to interrupt")
|
||||||
# Matches any: [symbol] [Task description]… (... esc to interrupt ...)
|
# Matches any: [symbol] [Task description]… (... to interrupt ...)
|
||||||
# Symbols include: * ✢ ✽ ✶ ✻ · • ◦ ○ ● ◆ and similar decorative characters
|
# Symbols include: * ✢ ✽ ✶ ✻ · • ◦ ○ ● ◆ and similar decorative characters
|
||||||
# Example: ✽ Reviewing script for issues… (esc to interrupt · ctrl+t to show todos · 1m 25s · ↑ 887 tokens)
|
# Example: ✽ Reviewing script for issues… (ctrl+c to interrupt · 33s · ↑ 1.6k tokens · thought for 4s)
|
||||||
claude_progress_match = re.search(
|
claude_progress_match = re.search(
|
||||||
r'[*✢✽✶✻·•◦○●◆]\s+\w+.*?…\s*\(.*esc to interrupt.*\)',
|
r'[*✢✽✶✻·•◦○●◆]\s+\w+.*?…\s*\(.*(?:esc|ctrl\+c) to interrupt.*\)',
|
||||||
text,
|
text,
|
||||||
re.IGNORECASE,
|
re.IGNORECASE,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user