Merged changes from testing. WARNING: breaking changes, you will need to update or regenerate your settings file. Use the example provided in config/settings/settings.conf or on arch use the .pacnew as a guide.
This commit is contained in:
@@ -22,7 +22,7 @@ class command:
|
||||
self.env["runtime"]["MemoryManager"].add_index_list(
|
||||
"clipboardHistory",
|
||||
self.env["runtime"]["SettingsManager"].get_setting_as_int(
|
||||
"general", "numberOfClipboards"
|
||||
"general", "number_of_clipboards"
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ class command:
|
||||
def update_spell_language(self):
|
||||
self.spellChecker = enchant.Dict(
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
)
|
||||
self.language = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
|
||||
def run(self):
|
||||
@@ -48,7 +48,7 @@ class command:
|
||||
return
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
!= self.language
|
||||
):
|
||||
|
||||
@@ -59,7 +59,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
current_layout = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"keyboard", "keyboardLayout"
|
||||
"keyboard", "keyboard_layout"
|
||||
)
|
||||
|
||||
# Extract layout name from full path if needed
|
||||
@@ -83,7 +83,7 @@ class command:
|
||||
|
||||
# Update setting and reload shortcuts
|
||||
self.env["runtime"]["SettingsManager"].set_setting(
|
||||
"keyboard", "keyboardLayout", next_layout
|
||||
"keyboard", "keyboard_layout", next_layout
|
||||
)
|
||||
|
||||
# Reload shortcuts with new layout
|
||||
|
||||
@@ -26,7 +26,7 @@ class command:
|
||||
def run(self):
|
||||
clipboard_file_path = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("general", "clipboardExportPath")
|
||||
].get_setting("general", "clipboard_export_path")
|
||||
clipboard_file_path = clipboard_file_path.replace(
|
||||
"$user", self.env["general"]["curr_user"]
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ class command:
|
||||
def run(self):
|
||||
clipboard_file_path = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("general", "clipboardExportPath")
|
||||
].get_setting("general", "clipboard_export_path")
|
||||
clipboard_file_path = clipboard_file_path.replace(
|
||||
"$user", self.env["general"]["curr_user"]
|
||||
)
|
||||
|
||||
@@ -18,7 +18,7 @@ class command:
|
||||
self.env["runtime"]["MemoryManager"].add_index_list(
|
||||
"clipboardHistory",
|
||||
self.env["runtime"]["SettingsManager"].get_setting_as_int(
|
||||
"general", "numberOfClipboards"
|
||||
"general", "number_of_clipboards"
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -18,17 +18,17 @@ class command:
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
# Use commandBuffer like other commands
|
||||
if "progressMonitoring" not in self.env["commandBuffer"]:
|
||||
if "progress_monitoring" not in self.env["commandBuffer"]:
|
||||
# Check if progress monitoring should be enabled by default from
|
||||
# settings
|
||||
try:
|
||||
default_enabled = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_bool("sound", "progressMonitoring")
|
||||
].get_setting_as_bool("sound", "progress_monitoring")
|
||||
except Exception as e:
|
||||
# If setting doesn't exist, default to False
|
||||
default_enabled = False
|
||||
self.env["commandBuffer"]["progressMonitoring"] = default_enabled
|
||||
self.env["commandBuffer"]["progress_monitoring"] = default_enabled
|
||||
self.env["commandBuffer"]["lastProgressTime"] = 0
|
||||
self.env["commandBuffer"]["lastProgressValue"] = -1
|
||||
|
||||
@@ -40,12 +40,12 @@ class command:
|
||||
|
||||
def run(self):
|
||||
# Check if commandBuffer exists
|
||||
if "progressMonitoring" not in self.env["commandBuffer"]:
|
||||
self.env["commandBuffer"]["progressMonitoring"] = False
|
||||
if "progress_monitoring" not in self.env["commandBuffer"]:
|
||||
self.env["commandBuffer"]["progress_monitoring"] = False
|
||||
self.env["commandBuffer"]["lastProgressTime"] = 0
|
||||
self.env["commandBuffer"]["lastProgressValue"] = -1
|
||||
|
||||
if self.env["commandBuffer"]["progressMonitoring"]:
|
||||
if self.env["commandBuffer"]["progress_monitoring"]:
|
||||
self.stop_progress_monitoring()
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("Progress monitoring disabled"), interrupt=True
|
||||
@@ -57,17 +57,17 @@ class command:
|
||||
)
|
||||
|
||||
def start_progress_monitoring(self):
|
||||
self.env["commandBuffer"]["progressMonitoring"] = True
|
||||
self.env["commandBuffer"]["progress_monitoring"] = True
|
||||
self.env["commandBuffer"]["lastProgressTime"] = time.time()
|
||||
self.env["commandBuffer"]["lastProgressValue"] = -1
|
||||
# Don't control speech - let user decide with silence_until_prompt
|
||||
|
||||
def stop_progress_monitoring(self):
|
||||
self.env["commandBuffer"]["progressMonitoring"] = False
|
||||
self.env["commandBuffer"]["progress_monitoring"] = False
|
||||
# Don't control speech - progress monitor is beep-only
|
||||
|
||||
def detect_progress(self, text):
|
||||
if not self.env["commandBuffer"]["progressMonitoring"]:
|
||||
if not self.env["commandBuffer"]["progress_monitoring"]:
|
||||
return
|
||||
|
||||
# Skip progress detection if current screen looks like a prompt
|
||||
|
||||
@@ -36,11 +36,11 @@ class command:
|
||||
def update_spell_language(self):
|
||||
self.spellChecker = enchant.Dict(
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
)
|
||||
self.language = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
|
||||
def run(self):
|
||||
@@ -51,7 +51,7 @@ class command:
|
||||
return
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
!= self.language
|
||||
):
|
||||
|
||||
@@ -36,11 +36,11 @@ class command:
|
||||
return
|
||||
self.spellChecker = enchant.Dict(
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
)
|
||||
self.language = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
|
||||
def run(self):
|
||||
@@ -51,7 +51,7 @@ class command:
|
||||
return
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
!= self.language
|
||||
):
|
||||
|
||||
@@ -25,15 +25,15 @@ class command:
|
||||
def run(self):
|
||||
self.env["runtime"]["SettingsManager"].set_setting(
|
||||
"general",
|
||||
"autoPresentIndent",
|
||||
"auto_present_indent",
|
||||
str(
|
||||
not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoPresentIndent"
|
||||
"general", "auto_present_indent"
|
||||
)
|
||||
),
|
||||
)
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoPresentIndent"
|
||||
"general", "auto_present_indent"
|
||||
):
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("autoindent enabled"), sound_icon="", interrupt=True
|
||||
|
||||
@@ -25,15 +25,15 @@ class command:
|
||||
def run(self):
|
||||
self.env["runtime"]["SettingsManager"].set_setting(
|
||||
"speech",
|
||||
"autoReadIncoming",
|
||||
"auto_read_incoming",
|
||||
str(
|
||||
not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"speech", "autoReadIncoming"
|
||||
"speech", "auto_read_incoming"
|
||||
)
|
||||
),
|
||||
)
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"speech", "autoReadIncoming"
|
||||
"speech", "auto_read_incoming"
|
||||
):
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("autoread enabled"), sound_icon="", interrupt=True
|
||||
|
||||
@@ -24,15 +24,15 @@ class command:
|
||||
def run(self):
|
||||
self.env["runtime"]["SettingsManager"].set_setting(
|
||||
"general",
|
||||
"autoSpellCheck",
|
||||
"auto_spell_check",
|
||||
str(
|
||||
not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoSpellCheck"
|
||||
"general", "auto_spell_check"
|
||||
)
|
||||
),
|
||||
)
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoSpellCheck"
|
||||
"general", "auto_spell_check"
|
||||
):
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("auto spellcheck enabled"), sound_icon="", interrupt=True
|
||||
|
||||
@@ -25,7 +25,7 @@ class command:
|
||||
if self.env["runtime"]["PunctuationManager"].cycle_punctuation():
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "punctuationLevel"
|
||||
"general", "punctuation_level"
|
||||
),
|
||||
interrupt=True,
|
||||
ignore_punctuation=True,
|
||||
|
||||
@@ -23,7 +23,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "interruptOnKeyPress"
|
||||
"keyboard", "interrupt_on_key_press"
|
||||
):
|
||||
return
|
||||
if self.env["runtime"]["InputManager"].no_key_pressed():
|
||||
@@ -37,13 +37,13 @@ class command:
|
||||
# if the filter is set
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("keyboard", "interruptOnKeyPressFilter")
|
||||
.get_setting("keyboard", "interrupt_on_key_press_filter")
|
||||
.strip()
|
||||
!= ""
|
||||
):
|
||||
filter_list = (
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("keyboard", "interruptOnKeyPressFilter")
|
||||
.get_setting("keyboard", "interrupt_on_key_press_filter")
|
||||
.split(",")
|
||||
)
|
||||
for currInput in self.env["input"]["currInput"]:
|
||||
|
||||
@@ -24,7 +24,7 @@ class command:
|
||||
def run(self):
|
||||
# enabled?
|
||||
active = self.env["runtime"]["SettingsManager"].get_setting_as_int(
|
||||
"keyboard", "charEchoMode"
|
||||
"keyboard", "char_echo_mode"
|
||||
)
|
||||
# 0 = off
|
||||
if active == 0:
|
||||
|
||||
@@ -26,7 +26,7 @@ class command:
|
||||
def run(self):
|
||||
# is it enabled?
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "wordEcho"
|
||||
"keyboard", "word_echo"
|
||||
):
|
||||
return
|
||||
# is navigation?
|
||||
|
||||
@@ -39,23 +39,23 @@ class command:
|
||||
return
|
||||
self.spellChecker = enchant.Dict(
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
)
|
||||
self.language = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
|
||||
def run(self):
|
||||
if not initialized:
|
||||
return
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoSpellCheck"
|
||||
"general", "auto_spell_check"
|
||||
):
|
||||
return
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "spellCheckLanguage"
|
||||
"general", "spell_check_language"
|
||||
)
|
||||
!= self.language
|
||||
):
|
||||
|
||||
@@ -23,7 +23,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "charDeleteEcho"
|
||||
"keyboard", "char_delete_echo"
|
||||
):
|
||||
return
|
||||
# detect typing or chilling
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class command:
|
||||
|
||||
# echo word insteed of char
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "wordEcho"
|
||||
"keyboard", "word_echo"
|
||||
):
|
||||
if (
|
||||
abs(
|
||||
|
||||
+3
-3
@@ -55,17 +55,17 @@ class command:
|
||||
self.lastIdent = curr_ident
|
||||
do_interrupt = True
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoPresentIndent"
|
||||
"general", "auto_present_indent"
|
||||
):
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_int(
|
||||
"general", "autoPresentIndentMode"
|
||||
"general", "auto_present_indent_mode"
|
||||
) in [0, 1]:
|
||||
if self.lastIdent != curr_ident:
|
||||
self.env["runtime"]["OutputManager"].play_frequence(
|
||||
curr_ident * 50, 0.1, interrupt=do_interrupt
|
||||
)
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_int(
|
||||
"general", "autoPresentIndentMode"
|
||||
"general", "auto_present_indent_mode"
|
||||
) in [0, 2]:
|
||||
if self.lastIdent != curr_ident:
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
|
||||
@@ -68,10 +68,10 @@ class command:
|
||||
|
||||
# Only beep/announce if indentation level has changed
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "autoPresentIndent"
|
||||
"general", "auto_present_indent"
|
||||
) and self.lastIdent != curr_ident:
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_int(
|
||||
"general", "autoPresentIndentMode"
|
||||
"general", "auto_present_indent_mode"
|
||||
) in [0, 1]:
|
||||
self.env["runtime"]["OutputManager"].play_frequence(
|
||||
curr_ident * 50, 0.1, interrupt=False
|
||||
|
||||
@@ -23,7 +23,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"review", "leaveReviewOnCursorChange"
|
||||
"review", "leave_review_on_cursor_change"
|
||||
):
|
||||
return
|
||||
if self.env["runtime"]["CursorManager"].is_review_mode():
|
||||
|
||||
@@ -22,7 +22,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "interruptOnKeyPress"
|
||||
"keyboard", "interrupt_on_key_press"
|
||||
):
|
||||
return
|
||||
if self.env["runtime"]["InputManager"].no_key_pressed():
|
||||
@@ -36,13 +36,13 @@ class command:
|
||||
# if the filter is set
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("keyboard", "interruptOnKeyPressFilter")
|
||||
.get_setting("keyboard", "interrupt_on_key_press_filter")
|
||||
.strip()
|
||||
!= ""
|
||||
):
|
||||
filter_list = (
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("keyboard", "interruptOnKeyPressFilter")
|
||||
.get_setting("keyboard", "interrupt_on_key_press_filter")
|
||||
.split(",")
|
||||
)
|
||||
for currInput in self.env["input"]["currInput"]:
|
||||
|
||||
@@ -23,7 +23,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"review", "leaveReviewOnScreenChange"
|
||||
"review", "leave_review_on_screen_change"
|
||||
):
|
||||
return
|
||||
self.env["runtime"]["CursorManager"].clear_review_cursor()
|
||||
|
||||
@@ -25,8 +25,8 @@ class command:
|
||||
# Only run if progress monitoring is enabled
|
||||
try:
|
||||
if (
|
||||
"progressMonitoring" in self.env["commandBuffer"]
|
||||
and self.env["commandBuffer"]["progressMonitoring"]
|
||||
"progress_monitoring" in self.env["commandBuffer"]
|
||||
and self.env["commandBuffer"]["progress_monitoring"]
|
||||
):
|
||||
# Check if current line is a prompt - if so, reset progress
|
||||
# state
|
||||
|
||||
@@ -42,7 +42,7 @@ class command:
|
||||
|
||||
def run(self):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"speech", "autoReadIncoming"
|
||||
"speech", "auto_read_incoming"
|
||||
):
|
||||
return
|
||||
# is there something to read?
|
||||
|
||||
@@ -38,7 +38,7 @@ class command:
|
||||
if int(time.time() - self.env["input"]["lastInputTime"]) < self.env[
|
||||
"runtime"
|
||||
]["SettingsManager"].get_setting_as_int(
|
||||
"promote", "inactiveTimeoutSec"
|
||||
"promote", "inactive_timeout_sec"
|
||||
):
|
||||
return
|
||||
if (
|
||||
|
||||
@@ -134,7 +134,7 @@ class config_command:
|
||||
|
||||
self.config.add_section("keyboard")
|
||||
self.config.set("keyboard", "driver", "evdevDriver")
|
||||
self.config.set("keyboard", "keyboardLayout", "desktop")
|
||||
self.config.set("keyboard", "keyboard_layout", "desktop")
|
||||
|
||||
self.config.add_section("screen")
|
||||
self.config.set("screen", "driver", "vcsaDriver")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set punctuation to All (every punctuation mark)"
|
||||
|
||||
def run(self):
|
||||
current_level = self.get_setting("general", "punctuationLevel", "some")
|
||||
current_level = self.get_setting("general", "punctuation_level", "some")
|
||||
|
||||
if current_level.lower() == "all":
|
||||
self.present_text("Punctuation level already set to All")
|
||||
return
|
||||
|
||||
success = self.set_setting("general", "punctuationLevel", "all")
|
||||
success = self.set_setting("general", "punctuation_level", "all")
|
||||
|
||||
if success:
|
||||
self.present_text("Punctuation level set to All - every punctuation mark will be spoken")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set punctuation to Most (detailed punctuation)"
|
||||
|
||||
def run(self):
|
||||
current_level = self.get_setting("general", "punctuationLevel", "some")
|
||||
current_level = self.get_setting("general", "punctuation_level", "some")
|
||||
|
||||
if current_level.lower() == "most":
|
||||
self.present_text("Punctuation level already set to Most")
|
||||
return
|
||||
|
||||
success = self.set_setting("general", "punctuationLevel", "most")
|
||||
success = self.set_setting("general", "punctuation_level", "most")
|
||||
|
||||
if success:
|
||||
self.present_text("Punctuation level set to Most - detailed punctuation will be spoken")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set punctuation to None (no punctuation spoken)"
|
||||
|
||||
def run(self):
|
||||
current_level = self.get_setting("general", "punctuationLevel", "some")
|
||||
current_level = self.get_setting("general", "punctuation_level", "some")
|
||||
|
||||
if current_level.lower() == "none":
|
||||
self.present_text("Punctuation level already set to None")
|
||||
return
|
||||
|
||||
success = self.set_setting("general", "punctuationLevel", "none")
|
||||
success = self.set_setting("general", "punctuation_level", "none")
|
||||
|
||||
if success:
|
||||
self.present_text("Punctuation level set to None - no punctuation will be spoken")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set punctuation to Some (basic punctuation only)"
|
||||
|
||||
def run(self):
|
||||
current_level = self.get_setting("general", "punctuationLevel", "some")
|
||||
current_level = self.get_setting("general", "punctuation_level", "some")
|
||||
|
||||
if current_level.lower() == "some":
|
||||
self.present_text("Punctuation level already set to Some")
|
||||
return
|
||||
|
||||
success = self.set_setting("general", "punctuationLevel", "some")
|
||||
success = self.set_setting("general", "punctuation_level", "some")
|
||||
|
||||
if success:
|
||||
self.present_text("Punctuation level set to Some - basic punctuation will be spoken")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set character echo to Always (echo all typed characters)"
|
||||
|
||||
def run(self):
|
||||
current_mode = self.get_setting("keyboard", "charEchoMode", "1")
|
||||
current_mode = self.get_setting("keyboard", "char_echo_mode", "1")
|
||||
|
||||
if current_mode == "1":
|
||||
self.present_text("Character echo already set to Always")
|
||||
return
|
||||
|
||||
success = self.set_setting("keyboard", "charEchoMode", "1")
|
||||
success = self.set_setting("keyboard", "char_echo_mode", "1")
|
||||
|
||||
if success:
|
||||
self.present_text("Character echo set to Always - all typed characters will be spoken")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set character echo to Caps Lock (echo only when caps lock is on)"
|
||||
|
||||
def run(self):
|
||||
current_mode = self.get_setting("keyboard", "charEchoMode", "1")
|
||||
current_mode = self.get_setting("keyboard", "char_echo_mode", "1")
|
||||
|
||||
if current_mode == "2":
|
||||
self.present_text("Character echo already set to Caps Lock mode")
|
||||
return
|
||||
|
||||
success = self.set_setting("keyboard", "charEchoMode", "2")
|
||||
success = self.set_setting("keyboard", "char_echo_mode", "2")
|
||||
|
||||
if success:
|
||||
self.present_text("Character echo set to Caps Lock mode - characters will be spoken only when caps lock is on")
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ class command(config_command):
|
||||
return "Set character echo to None (no character echo)"
|
||||
|
||||
def run(self):
|
||||
current_mode = self.get_setting("keyboard", "charEchoMode", "1")
|
||||
current_mode = self.get_setting("keyboard", "char_echo_mode", "1")
|
||||
|
||||
if current_mode == "0":
|
||||
self.present_text("Character echo already set to None")
|
||||
return
|
||||
|
||||
success = self.set_setting("keyboard", "charEchoMode", "0")
|
||||
success = self.set_setting("keyboard", "char_echo_mode", "0")
|
||||
|
||||
if success:
|
||||
self.present_text("Character echo set to None - no typed characters will be spoken")
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ class command(config_command):
|
||||
return "Toggle exclusive keyboard access"
|
||||
|
||||
def run(self):
|
||||
current_state = self.getBooleanSetting("keyboard", "grabDevices", True)
|
||||
new_state = self.toggleBooleanSetting("keyboard", "grabDevices")
|
||||
current_state = self.getBooleanSetting("keyboard", "grab_devices", True)
|
||||
new_state = self.toggleBooleanSetting("keyboard", "grab_devices")
|
||||
|
||||
if new_state != current_state:
|
||||
state_text = "enabled" if new_state else "disabled"
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ class command(config_command):
|
||||
return "Toggle word echo when pressing space"
|
||||
|
||||
def run(self):
|
||||
current_state = self.getBooleanSetting("keyboard", "wordEcho", False)
|
||||
new_state = self.toggleBooleanSetting("keyboard", "wordEcho")
|
||||
current_state = self.getBooleanSetting("keyboard", "word_echo", False)
|
||||
new_state = self.toggleBooleanSetting("keyboard", "word_echo")
|
||||
|
||||
if new_state != current_state:
|
||||
state_text = "enabled" if new_state else "disabled"
|
||||
|
||||
+7
-7
@@ -108,7 +108,7 @@ class command(config_command):
|
||||
"rate": "0.5",
|
||||
"pitch": "0.5",
|
||||
"volume": "1.0",
|
||||
"autoReadIncoming": "True",
|
||||
"auto_read_incoming": "True",
|
||||
}
|
||||
|
||||
# Basic sound defaults
|
||||
@@ -123,10 +123,10 @@ class command(config_command):
|
||||
self.config["keyboard"] = {
|
||||
"driver": "evdevDriver",
|
||||
"device": "ALL",
|
||||
"keyboardLayout": "desktop",
|
||||
"charEchoMode": "1",
|
||||
"wordEcho": "False",
|
||||
"charDeleteEcho": "True",
|
||||
"keyboard_layout": "desktop",
|
||||
"char_echo_mode": "1",
|
||||
"word_echo": "False",
|
||||
"char_delete_echo": "True",
|
||||
}
|
||||
|
||||
# Basic screen defaults
|
||||
@@ -137,9 +137,9 @@ class command(config_command):
|
||||
|
||||
# Basic general defaults
|
||||
self.config["general"] = {
|
||||
"punctuationLevel": "some",
|
||||
"punctuation_level": "some",
|
||||
"debug_level": "0",
|
||||
"numberOfClipboards": "50",
|
||||
"number_of_clipboards": "50",
|
||||
}
|
||||
|
||||
# Write the configuration
|
||||
|
||||
@@ -112,7 +112,7 @@ class ByteManager:
|
||||
if self.lastByteKey == converted_escape_sequence:
|
||||
if time.time() - self.lastInputTime <= self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_float("keyboard", "doubleTapTimeout"):
|
||||
].get_setting_as_float("keyboard", "double_tap_timeout"):
|
||||
self.repeat += 1
|
||||
shortcut_data = b""
|
||||
for i in range(self.repeat):
|
||||
|
||||
@@ -29,7 +29,7 @@ class DynamicKeyboardLayoutCommand:
|
||||
try:
|
||||
settingsManager = self.env["runtime"]["SettingsManager"]
|
||||
currentLayout = settingsManager.get_setting(
|
||||
"keyboard", "keyboardLayout"
|
||||
"keyboard", "keyboard_layout"
|
||||
)
|
||||
|
||||
# Check if already set (compare both full path and base name)
|
||||
@@ -44,7 +44,7 @@ class DynamicKeyboardLayoutCommand:
|
||||
try:
|
||||
# Update the setting in memory
|
||||
settingsManager.set_setting(
|
||||
"keyboard", "keyboardLayout", self.layoutPath
|
||||
"keyboard", "keyboard_layout", self.layoutPath
|
||||
)
|
||||
|
||||
# Save to the actual config file
|
||||
@@ -162,7 +162,7 @@ def get_keyboard_layouts(env):
|
||||
# Get current layout setting path
|
||||
try:
|
||||
currentLayoutSetting = env["runtime"]["SettingsManager"].get_setting(
|
||||
"keyboard", "keyboardLayout"
|
||||
"keyboard", "keyboard_layout"
|
||||
)
|
||||
if currentLayoutSetting and os.path.exists(currentLayoutSetting):
|
||||
currentLayoutDir = os.path.dirname(currentLayoutSetting)
|
||||
|
||||
@@ -89,7 +89,7 @@ class InputManager:
|
||||
if not self.no_key_pressed():
|
||||
return
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
self.executeDeviceGrab = False
|
||||
return
|
||||
@@ -208,7 +208,7 @@ class InputManager:
|
||||
elif self.lastDeepestInput == self.env["input"]["currInput"]:
|
||||
if time.time() - self.lastInputTime <= self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_float("keyboard", "doubleTapTimeout"):
|
||||
].get_setting_as_float("keyboard", "double_tap_timeout"):
|
||||
self.env["input"]["shortcut_repeat"] += 1
|
||||
else:
|
||||
self.env["input"]["shortcut_repeat"] = 1
|
||||
@@ -255,7 +255,7 @@ class InputManager:
|
||||
|
||||
def grab_all_devices(self):
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
try:
|
||||
return self.env["runtime"]["InputDriver"].grab_all_devices()
|
||||
@@ -265,7 +265,7 @@ class InputManager:
|
||||
|
||||
def ungrab_all_devices(self):
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
try:
|
||||
return self.env["runtime"]["InputDriver"].ungrab_all_devices()
|
||||
@@ -355,7 +355,7 @@ class InputManager:
|
||||
def write_event_buffer(self):
|
||||
try:
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
self.env["runtime"]["InputDriver"].write_event_buffer()
|
||||
self.clear_event_buffer()
|
||||
@@ -572,7 +572,7 @@ class InputManager:
|
||||
|
||||
# Get current layout path
|
||||
layout_setting = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"keyboard", "keyboardLayout"
|
||||
"keyboard", "keyboard_layout"
|
||||
)
|
||||
|
||||
# Resolve full path if needed
|
||||
|
||||
@@ -49,7 +49,7 @@ class OutputManager:
|
||||
return
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"speech", "readNumbersAsDigits"
|
||||
"speech", "read_numbers_as_digits"
|
||||
)
|
||||
and len(text.strip()) > 1
|
||||
):
|
||||
@@ -157,7 +157,7 @@ class OutputManager:
|
||||
self.env["runtime"]["SpeechDriver"].set_pitch(
|
||||
self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_float("speech", "capitalPitch")
|
||||
].get_setting_as_float("speech", "capital_pitch")
|
||||
)
|
||||
else:
|
||||
self.env["runtime"]["SpeechDriver"].set_pitch(
|
||||
@@ -221,7 +221,7 @@ class OutputManager:
|
||||
|
||||
try:
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "newLinePause"
|
||||
"general", "new_line_pause"
|
||||
):
|
||||
clean_text = text.replace("\n", " , ")
|
||||
else:
|
||||
|
||||
@@ -52,7 +52,7 @@ class PunctuationManager:
|
||||
|
||||
# Check if we should replace undefined punctuation with spaces
|
||||
replace_with_space = self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"general", "replaceUndefinedPunctuationWithSpace"
|
||||
"general", "replace_undefined_punctuation_with_space"
|
||||
)
|
||||
|
||||
# If the setting is disabled, use the old behavior (remove completely)
|
||||
@@ -128,7 +128,7 @@ class PunctuationManager:
|
||||
) and key not in " ":
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "respectPunctuationPause"
|
||||
"general", "respect_punctuation_pause"
|
||||
)
|
||||
and len(key) == 1
|
||||
and key in "',.;:?!"
|
||||
@@ -161,13 +161,13 @@ class PunctuationManager:
|
||||
curr_punct_level = ""
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("general", "punctuationLevel")
|
||||
.get_setting("general", "punctuation_level")
|
||||
.lower()
|
||||
in self.env["punctuation"]["LEVELDICT"]
|
||||
):
|
||||
curr_punct_level = self.env["punctuation"]["LEVELDICT"][
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("general", "punctuationLevel")
|
||||
.get_setting("general", "punctuation_level")
|
||||
.lower()
|
||||
]
|
||||
else:
|
||||
@@ -183,7 +183,7 @@ class PunctuationManager:
|
||||
try:
|
||||
curr_index = punct_list.index(
|
||||
self.env["runtime"]["SettingsManager"]
|
||||
.get_setting("general", "punctuationLevel")
|
||||
.get_setting("general", "punctuation_level")
|
||||
.lower()
|
||||
) # curr punctuation
|
||||
except Exception as e:
|
||||
@@ -193,7 +193,7 @@ class PunctuationManager:
|
||||
curr_index = 0
|
||||
curr_level = punct_list[curr_index]
|
||||
self.env["runtime"]["SettingsManager"].set_setting(
|
||||
"general", "punctuationLevel", curr_level.lower()
|
||||
"general", "punctuation_level", curr_level.lower()
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ class QuickMenuManager(SpeechHelperMixin):
|
||||
|
||||
# Load base menu from config
|
||||
menu_string = self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"menu", "quickMenu"
|
||||
"menu", "quick_menu"
|
||||
)
|
||||
|
||||
# Dynamically add speech-dispatcher specific items
|
||||
|
||||
@@ -69,7 +69,7 @@ class RemoteManager:
|
||||
|
||||
def handle_settings_change_with_response(self, settings_text):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"remote", "enableSettingsRemote"
|
||||
"remote", "enable_settings_remote"
|
||||
):
|
||||
return {
|
||||
"success": False,
|
||||
@@ -115,7 +115,7 @@ class RemoteManager:
|
||||
|
||||
def handle_settings_change(self, settings_text):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"remote", "enableSettingsRemote"
|
||||
"remote", "enable_settings_remote"
|
||||
):
|
||||
return
|
||||
|
||||
@@ -137,7 +137,7 @@ class RemoteManager:
|
||||
|
||||
def handle_command_execution_with_response(self, command_text):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"remote", "enableCommandRemote"
|
||||
"remote", "enable_command_remote"
|
||||
):
|
||||
return {
|
||||
"success": False,
|
||||
@@ -218,7 +218,7 @@ class RemoteManager:
|
||||
|
||||
def handle_command_execution(self, command_text):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"remote", "enableCommandRemote"
|
||||
"remote", "enable_command_remote"
|
||||
):
|
||||
return
|
||||
|
||||
@@ -309,7 +309,7 @@ class RemoteManager:
|
||||
def export_clipboard(self):
|
||||
clipboard_file_path = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("general", "clipboardExportPath")
|
||||
].get_setting("general", "clipboard_export_path")
|
||||
clipboard_file_path = clipboard_file_path.replace(
|
||||
"$user", self.env["general"]["curr_user"]
|
||||
)
|
||||
|
||||
@@ -429,11 +429,11 @@ class ScreenManager:
|
||||
ignore_screens = []
|
||||
fix_ignore_screens = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("screen", "ignoreScreen")
|
||||
].get_setting("screen", "ignore_screen")
|
||||
if fix_ignore_screens != "":
|
||||
ignore_screens.extend(fix_ignore_screens.split(","))
|
||||
if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"screen", "autodetectIgnoreScreen"
|
||||
"screen", "autodetect_ignore_screen"
|
||||
):
|
||||
ignore_screens.extend(self.env["screen"]["autoIgnoreScreens"])
|
||||
self.env["runtime"]["DebugManager"].write_debug_out(
|
||||
|
||||
@@ -12,59 +12,61 @@ settings_data = {
|
||||
"driver": "genericDriver",
|
||||
"theme": "default",
|
||||
"volume": 1.0,
|
||||
"genericPlayFileCommand": "play -q -v fenrirVolume fenrirSoundFile",
|
||||
"genericFrequencyCommand": "play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence",
|
||||
"generic_play_file_command": "play -q -v fenrirVolume fenrirSoundFile",
|
||||
"generic_frequency_command": "play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence",
|
||||
"progress_monitoring": True,
|
||||
},
|
||||
"speech": {
|
||||
"enabled": True,
|
||||
"driver": "genericDriver",
|
||||
"serverPath": "",
|
||||
"server_path": "",
|
||||
"rate": 0.75,
|
||||
"pitch": 0.5,
|
||||
"capitalPitch": 0.8,
|
||||
"capital_pitch": 0.8,
|
||||
"volume": 1.0,
|
||||
"module": "",
|
||||
"voice": "en-us",
|
||||
"language": "",
|
||||
"autoReadIncoming": True,
|
||||
"readNumbersAsDigits": False,
|
||||
"genericSpeechCommand": 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"',
|
||||
"fenrirMinVolume": 0,
|
||||
"fenrirMaxVolume": 200,
|
||||
"fenrirMinPitch": 0,
|
||||
"fenrirMaxPitch": 99,
|
||||
"fenrirMinRate": 80,
|
||||
"fenrirMaxRate": 450,
|
||||
"auto_read_incoming": True,
|
||||
"read_numbers_as_digits": False,
|
||||
"generic_speech_command": 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"',
|
||||
"fenrir_min_volume": 0,
|
||||
"fenrir_max_volume": 200,
|
||||
"fenrir_min_pitch": 0,
|
||||
"fenrir_max_pitch": 99,
|
||||
"fenrir_min_rate": 80,
|
||||
"fenrir_max_rate": 450,
|
||||
},
|
||||
"screen": {
|
||||
"driver": "vcsaDriver",
|
||||
"encoding": "auto",
|
||||
"screenUpdateDelay": 0.1,
|
||||
"ignoreScreen": "",
|
||||
"autodetectIgnoreScreen": False,
|
||||
"screen_update_delay": 0.1,
|
||||
"ignore_screen": "",
|
||||
"autodetect_ignore_screen": False,
|
||||
},
|
||||
"general": {
|
||||
"debug_level": debug.DebugLevel.DEACTIVE,
|
||||
"debug_mode": "FILE",
|
||||
"debugFile": "",
|
||||
"punctuationProfile": "default",
|
||||
"punctuationLevel": "some",
|
||||
"respectPunctuationPause": True,
|
||||
"replaceUndefinedPunctuationWithSpace": True,
|
||||
"newLinePause": True,
|
||||
"numberOfClipboards": 10,
|
||||
"debug_file": "",
|
||||
"punctuation_profile": "default",
|
||||
"punctuation_level": "some",
|
||||
"respect_punctuation_pause": True,
|
||||
"replace_undefined_punctuation_with_space": True,
|
||||
"new_line_pause": True,
|
||||
"number_of_clipboards": 10,
|
||||
"clipboard_export_path": "/tmp/fenrirClipboard",
|
||||
"emoticons": True,
|
||||
"fenrirKeys": "KEY_KP0,KEY_META",
|
||||
"scriptKeys": "KEY_COMPOSE",
|
||||
"fenrir_keys": "KEY_KP0,KEY_META",
|
||||
"script_keys": "KEY_COMPOSE",
|
||||
"time_format": "%I:%M%P",
|
||||
"date_format": "%A, %B %d, %Y",
|
||||
"autoSpellCheck": False,
|
||||
"spellCheckLanguage": "en_US",
|
||||
"auto_spell_check": False,
|
||||
"spell_check_language": "en_US",
|
||||
"script_path": "/usr/share/fenrirscreenreader/scripts",
|
||||
"command_path": "/usr/share/fenrirscreenreader/commands",
|
||||
"attribute_format_string": "Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize",
|
||||
"autoPresentIndent": False,
|
||||
"autoPresentIndentMode": 1,
|
||||
"auto_present_indent": False,
|
||||
"auto_present_indent_mode": 1,
|
||||
"has_attributes": True,
|
||||
"shell": "",
|
||||
},
|
||||
@@ -77,8 +79,8 @@ settings_data = {
|
||||
"driver": "unixDriver",
|
||||
"port": 22447,
|
||||
"socket_file": "",
|
||||
"enableSettingsRemote": True,
|
||||
"enableCommandRemote": True,
|
||||
"enable_settings_remote": True,
|
||||
"enable_command_remote": True,
|
||||
},
|
||||
"barrier": {
|
||||
"enabled": True,
|
||||
@@ -88,16 +90,16 @@ settings_data = {
|
||||
"review": {
|
||||
"line_break": True,
|
||||
"end_of_screen": True,
|
||||
"leaveReviewOnCursorChange": True,
|
||||
"leaveReviewOnScreenChange": True,
|
||||
"leave_review_on_cursor_change": True,
|
||||
"leave_review_on_screen_change": True,
|
||||
},
|
||||
"menu": {
|
||||
"vmenuPath": "",
|
||||
"quickMenu": "speech#rate;speech#pitch;speech#volume",
|
||||
"vmenu_path": "",
|
||||
"quick_menu": "speech#rate;speech#pitch;speech#volume",
|
||||
},
|
||||
"promote": {
|
||||
"enabled": True,
|
||||
"inactiveTimeoutSec": 120,
|
||||
"inactive_timeout_sec": 120,
|
||||
"list": "",
|
||||
},
|
||||
"time": {
|
||||
@@ -112,14 +114,14 @@ settings_data = {
|
||||
"keyboard": {
|
||||
"driver": "evdev",
|
||||
"device": "all",
|
||||
"grabDevices": True,
|
||||
"ignoreShortcuts": False,
|
||||
"keyboardLayout": "desktop",
|
||||
"charEchoMode": 2, # while capslock
|
||||
"charDeleteEcho": True,
|
||||
"wordEcho": True,
|
||||
"interruptOnKeyPress": True,
|
||||
"interruptOnKeyPressFilter": "",
|
||||
"doubleTapTimeout": 0.2,
|
||||
"grab_devices": True,
|
||||
"ignore_shortcuts": False,
|
||||
"keyboard_layout": "desktop",
|
||||
"char_echo_mode": 2, # while capslock
|
||||
"char_delete_echo": True,
|
||||
"word_echo": True,
|
||||
"interrupt_on_key_press": True,
|
||||
"interrupt_on_key_press_filter": "",
|
||||
"double_tap_timeout": 0.2,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ class SettingsManager:
|
||||
# Set PTY driver settings
|
||||
pty_settings = {
|
||||
"screen": {"driver": "ptyDriver"},
|
||||
"keyboard": {"driver": "ptyDriver", "keyboardLayout": "pty"}
|
||||
"keyboard": {"driver": "ptyDriver", "keyboard_layout": "pty"}
|
||||
}
|
||||
for section, settings in pty_settings.items():
|
||||
for key, value in settings.items():
|
||||
@@ -507,12 +507,12 @@ class SettingsManager:
|
||||
self.set_setting("screen", "driver", "ptyDriver")
|
||||
self.set_setting("keyboard", "driver", "evdevDriver")
|
||||
|
||||
self.set_fenrir_keys(self.get_setting("general", "fenrirKeys"))
|
||||
self.set_script_keys(self.get_setting("general", "scriptKeys"))
|
||||
self.set_fenrir_keys(self.get_setting("general", "fenrir_keys"))
|
||||
self.set_script_keys(self.get_setting("general", "script_keys"))
|
||||
|
||||
environment["runtime"]["DebugManager"] = debugManager.DebugManager(
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"general", "debugFile"
|
||||
"general", "debug_file"
|
||||
)
|
||||
)
|
||||
environment["runtime"]["DebugManager"].initialize(environment)
|
||||
@@ -521,7 +521,7 @@ class SettingsManager:
|
||||
environment["runtime"]["force_all_screens"] = True
|
||||
|
||||
if cliArgs.ignore_screen:
|
||||
current_ignore_screen = self.get_setting("screen", "ignoreScreen")
|
||||
current_ignore_screen = self.get_setting("screen", "ignore_screen")
|
||||
if current_ignore_screen:
|
||||
ignore_screens = (
|
||||
current_ignore_screen.split(",") + cliArgs.ignore_screen
|
||||
@@ -529,7 +529,7 @@ class SettingsManager:
|
||||
else:
|
||||
ignore_screens = cliArgs.ignore_screen
|
||||
self.set_setting(
|
||||
"screen", "ignoreScreen", ",".join(ignore_screens)
|
||||
"screen", "ignore_screen", ",".join(ignore_screens)
|
||||
)
|
||||
|
||||
if not os.path.exists(
|
||||
@@ -561,43 +561,43 @@ class SettingsManager:
|
||||
environment["runtime"]["TextManager"].initialize(environment)
|
||||
|
||||
if not os.path.exists(
|
||||
self.get_setting("general", "punctuationProfile")
|
||||
self.get_setting("general", "punctuation_profile")
|
||||
):
|
||||
if os.path.exists(
|
||||
settings_root
|
||||
+ "punctuation/"
|
||||
+ self.get_setting("general", "punctuationProfile")
|
||||
+ self.get_setting("general", "punctuation_profile")
|
||||
):
|
||||
self.set_setting(
|
||||
"general",
|
||||
"punctuationProfile",
|
||||
"punctuation_profile",
|
||||
settings_root
|
||||
+ "punctuation/"
|
||||
+ self.get_setting("general", "punctuationProfile"),
|
||||
+ self.get_setting("general", "punctuation_profile"),
|
||||
)
|
||||
environment["runtime"]["PunctuationManager"].load_dicts(
|
||||
self.get_setting("general", "punctuationProfile")
|
||||
self.get_setting("general", "punctuation_profile")
|
||||
)
|
||||
if os.path.exists(
|
||||
settings_root
|
||||
+ "punctuation/"
|
||||
+ self.get_setting("general", "punctuationProfile")
|
||||
+ self.get_setting("general", "punctuation_profile")
|
||||
+ ".conf"
|
||||
):
|
||||
self.set_setting(
|
||||
"general",
|
||||
"punctuationProfile",
|
||||
"punctuation_profile",
|
||||
settings_root
|
||||
+ "punctuation/"
|
||||
+ self.get_setting("general", "punctuationProfile")
|
||||
+ self.get_setting("general", "punctuation_profile")
|
||||
+ ".conf",
|
||||
)
|
||||
environment["runtime"]["PunctuationManager"].load_dicts(
|
||||
self.get_setting("general", "punctuationProfile")
|
||||
self.get_setting("general", "punctuation_profile")
|
||||
)
|
||||
else:
|
||||
environment["runtime"]["PunctuationManager"].load_dicts(
|
||||
self.get_setting("general", "punctuationProfile")
|
||||
self.get_setting("general", "punctuation_profile")
|
||||
)
|
||||
|
||||
if fenrir_manager:
|
||||
@@ -644,86 +644,86 @@ class SettingsManager:
|
||||
|
||||
if environment["runtime"]["InputManager"].get_shortcut_type() == "KEY":
|
||||
if not os.path.exists(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
):
|
||||
if os.path.exists(
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout")
|
||||
+ self.get_setting("keyboard", "keyboard_layout")
|
||||
):
|
||||
self.set_setting(
|
||||
"keyboard",
|
||||
"keyboardLayout",
|
||||
"keyboard_layout",
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout"),
|
||||
+ self.get_setting("keyboard", "keyboard_layout"),
|
||||
)
|
||||
environment["runtime"]["InputManager"].load_shortcuts(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
)
|
||||
if os.path.exists(
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout")
|
||||
+ self.get_setting("keyboard", "keyboard_layout")
|
||||
+ ".conf"
|
||||
):
|
||||
self.set_setting(
|
||||
"keyboard",
|
||||
"keyboardLayout",
|
||||
"keyboard_layout",
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout")
|
||||
+ self.get_setting("keyboard", "keyboard_layout")
|
||||
+ ".conf",
|
||||
)
|
||||
environment["runtime"]["InputManager"].load_shortcuts(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
)
|
||||
else:
|
||||
environment["runtime"]["InputManager"].load_shortcuts(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
)
|
||||
elif (
|
||||
environment["runtime"]["InputManager"].get_shortcut_type()
|
||||
== "BYTE"
|
||||
):
|
||||
if not os.path.exists(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
):
|
||||
if os.path.exists(
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout")
|
||||
+ self.get_setting("keyboard", "keyboard_layout")
|
||||
):
|
||||
self.set_setting(
|
||||
"keyboard",
|
||||
"keyboardLayout",
|
||||
"keyboard_layout",
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout"),
|
||||
+ self.get_setting("keyboard", "keyboard_layout"),
|
||||
)
|
||||
environment["runtime"]["ByteManager"].load_byte_shortcuts(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
)
|
||||
if os.path.exists(
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout")
|
||||
+ self.get_setting("keyboard", "keyboard_layout")
|
||||
+ ".conf"
|
||||
):
|
||||
self.set_setting(
|
||||
"keyboard",
|
||||
"keyboardLayout",
|
||||
"keyboard_layout",
|
||||
settings_root
|
||||
+ "keyboard/"
|
||||
+ self.get_setting("keyboard", "keyboardLayout")
|
||||
+ self.get_setting("keyboard", "keyboard_layout")
|
||||
+ ".conf",
|
||||
)
|
||||
environment["runtime"]["ByteManager"].load_byte_shortcuts(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
)
|
||||
else:
|
||||
environment["runtime"]["ByteManager"].load_byte_shortcuts(
|
||||
self.get_setting("keyboard", "keyboardLayout")
|
||||
self.get_setting("keyboard", "keyboard_layout")
|
||||
)
|
||||
|
||||
environment["runtime"]["CursorManager"] = cursorManager.CursorManager()
|
||||
|
||||
@@ -40,13 +40,13 @@ class VmenuManager:
|
||||
# if there is no user configuration
|
||||
if (
|
||||
self.env["runtime"]["SettingsManager"].get_setting(
|
||||
"menu", "vmenuPath"
|
||||
"menu", "vmenu_path"
|
||||
)
|
||||
!= ""
|
||||
):
|
||||
self.defaultVMenuPath = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("menu", "vmenuPath")
|
||||
].get_setting("menu", "vmenu_path")
|
||||
if not self.defaultVMenuPath.endswith("/"):
|
||||
self.defaultVMenuPath += "/"
|
||||
self.defaultVMenuPath += self.env["runtime"][
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributors.
|
||||
|
||||
version = "2025.12.03"
|
||||
version = "2025.12.10"
|
||||
code_name = "master"
|
||||
|
||||
@@ -284,7 +284,8 @@ class driver(inputDriver):
|
||||
)
|
||||
event_fired = True
|
||||
else:
|
||||
if event.type in [2, 3]:
|
||||
# Forward non-keyboard events: 2=EV_REL, 3=EV_ABS, 17=EV_LED
|
||||
if event.type in [2, 3, 17]:
|
||||
foreward = True
|
||||
|
||||
event = device.read_one()
|
||||
@@ -622,7 +623,7 @@ class driver(inputDriver):
|
||||
|
||||
def create_u_input_dev(self, fd):
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
self.uDevices[fd] = None
|
||||
return
|
||||
@@ -729,7 +730,7 @@ class driver(inputDriver):
|
||||
Only effective if grabDevices setting is enabled.
|
||||
"""
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
return True
|
||||
|
||||
@@ -791,7 +792,7 @@ class driver(inputDriver):
|
||||
bool: True if ungrab successful, False otherwise
|
||||
"""
|
||||
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
|
||||
"keyboard", "grabDevices"
|
||||
"keyboard", "grab_devices"
|
||||
):
|
||||
return True
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@ class driver(sound_driver):
|
||||
self.env = environment
|
||||
self.soundFileCommand = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("sound", "genericPlayFileCommand")
|
||||
].get_setting("sound", "generic_play_file_command")
|
||||
self.frequenceCommand = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("sound", "genericFrequencyCommand")
|
||||
].get_setting("sound", "generic_frequency_command")
|
||||
if self.soundFileCommand == "":
|
||||
self.soundFileCommand = "play -q -v fenrirVolume fenrirSoundFile"
|
||||
if self.frequenceCommand == "":
|
||||
|
||||
@@ -38,26 +38,26 @@ class driver(speech_driver):
|
||||
self.env = environment
|
||||
self.minVolume = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_int("speech", "fenrirMinVolume")
|
||||
].get_setting_as_int("speech", "fenrir_min_volume")
|
||||
self.maxVolume = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_int("speech", "fenrirMaxVolume")
|
||||
].get_setting_as_int("speech", "fenrir_max_volume")
|
||||
self.minPitch = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_int("speech", "fenrirMinPitch")
|
||||
].get_setting_as_int("speech", "fenrir_min_pitch")
|
||||
self.maxPitch = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_int("speech", "fenrirMaxPitch")
|
||||
].get_setting_as_int("speech", "fenrir_max_pitch")
|
||||
self.minRate = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_int("speech", "fenrirMinRate")
|
||||
].get_setting_as_int("speech", "fenrir_min_rate")
|
||||
self.maxRate = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting_as_int("speech", "fenrirMaxRate")
|
||||
].get_setting_as_int("speech", "fenrir_max_rate")
|
||||
|
||||
self.speechCommand = self.env["runtime"][
|
||||
"SettingsManager"
|
||||
].get_setting("speech", "genericSpeechCommand")
|
||||
].get_setting("speech", "generic_speech_command")
|
||||
if self.speechCommand == "":
|
||||
self.speechCommand = 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText"'
|
||||
if False: # for debugging overwrite here
|
||||
|
||||
Reference in New Issue
Block a user