16 Commits

Author SHA1 Message Date
Storm Dragon 9e8d0b3869 Latest changes. 2025-12-30 04:10:52 -05:00
Storm Dragon d7f86ca0de Setting added to choose caps notification type, beep, pitch, both or none. 2025-12-30 04:09:25 -05:00
Storm Dragon 49a79d2722 Removed promoted text option. It wasn't all that useful, and the new speech restore performs the same thing more affectively. 2025-12-28 19:07:54 -05:00
Storm Dragon 4ab024d115 Mostly progress bar fixes. 2025-12-22 12:51:15 -05:00
Storm Dragon c4ae27a01b More progress bar tweaks. 2025-12-20 06:59:19 -05:00
Storm Dragon 668d39b444 Merged for wider testing. 2025-12-19 12:56:33 -05:00
Storm Dragon 8b25afbf5a More progress bar updates. 2025-12-19 12:55:17 -05:00
Storm Dragon efeb040f75 Spelling error and case fixes. Everything seems to work so far. 2025-12-19 03:46:18 -05:00
Storm Dragon 7a17b36d50 More update work on readme and settings. 2025-12-19 03:07:46 -05:00
Storm Dragon 047a31b4bf Latest changes. 2025-12-19 00:11:04 -05:00
Storm Dragon 096aef9f08 Progress bar detection updates. 2025-12-14 19:05:18 -05:00
Storm Dragon 76472b83b5 Fixed a comment in settings file. 2025-12-10 20:20:56 -05:00
Storm Dragon a52bf624ec 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. 2025-12-10 20:12:07 -05:00
Storm Dragon f4e28a246f Second pass on updating settings, missed a few the first go round. 2025-12-10 20:08:01 -05:00
Storm Dragon 560ceb26c9 Major: Convert all settings from camelCase to snake_case for PEP8 compliance (WARNING! BREAKING CHANGES)
Breaking change for v3.0 - users must update their settings.conf file.

  - Converted 45 settings across all sections
  - Updated 524 Python files, tests, and documentation
  - All tests passing, zero regressions
  - Moving forward the philosophy is clean code over backward compatibility
  - Next stable release will be considered a major release
2025-12-10 19:39:45 -05:00
Storm Dragon 61868c94e5 Experimental fix to hopefully let users who rebind their capslock key keep those settings while using Fenrir. 2025-12-10 08:22:17 -05:00
73 changed files with 708 additions and 723 deletions
+31 -31
View File
@@ -222,7 +222,7 @@ Fenrir supports two main keyboard layouts:
Configure in `/etc/fenrir/settings/settings.conf`: Configure in `/etc/fenrir/settings/settings.conf`:
```ini ```ini
[keyboard] [keyboard]
keyboardLayout=desktop # or 'laptop' keyboard_layout=desktop # or 'laptop'
``` ```
### First Time Setup ### First Time Setup
@@ -255,9 +255,9 @@ Enable remote control in `/etc/fenrir/settings/settings.conf`:
enable=True enable=True
driver=unixDriver # or tcpDriver driver=unixDriver # or tcpDriver
port=22447 # for TCP driver port=22447 # for TCP driver
socketFile= # custom socket path (optional) socket_file= # custom socket path (optional)
enableSettingsRemote=True # allow settings changes enable_settings_remote=True # allow settings changes
enableCommandRemote=True # allow command execution enable_command_remote=True # allow command execution
``` ```
### Remote Drivers ### Remote Drivers
@@ -299,8 +299,8 @@ echo "setting set speech#pitch=0.6" | socat - UNIX-CLIENT:/tmp/fenrirscreenreade
echo "setting set speech#volume=0.9" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#volume=0.9" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Change punctuation level (none/some/most/all) # Change punctuation level (none/some/most/all)
echo "setting set general#punctuationLevel=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set general#punctuation_level=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
echo "setting set general#punctuationLevel=none" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set general#punctuation_level=none" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Voice and TTS engine control # Voice and TTS engine control
echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
@@ -311,14 +311,14 @@ echo "setting set sound#enabled=False" | socat - UNIX-CLIENT:/tmp/fenrirscreenre
echo "setting set sound#volume=0.5" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set sound#volume=0.5" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Keyboard and input settings # Keyboard and input settings
echo "setting set keyboard#charEchoMode=1" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set keyboard#char_echo_mode=1" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
echo "setting set keyboard#wordEcho=True" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set keyboard#word_echo=True" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Screen control (ignore specific TTYs) # Screen control (ignore specific TTYs)
echo "setting set screen#ignoreScreen=1,2,3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set screen#ignore_screen=1,2,3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Multiple settings at once # Multiple settings at once
echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuationLevel=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuation_level=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Reset all settings to defaults # Reset all settings to defaults
echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
@@ -421,7 +421,7 @@ setting <action> [parameters]
- `speech#voice=voice_name` - Voice selection (e.g., "en-us+f3") - `speech#voice=voice_name` - Voice selection (e.g., "en-us+f3")
- `speech#module=module_name` - TTS module (e.g., "espeak-ng") - `speech#module=module_name` - TTS module (e.g., "espeak-ng")
- `speech#driver=driver_name` - Speech driver (speechdDriver/genericDriver) - `speech#driver=driver_name` - Speech driver (speechdDriver/genericDriver)
- `speech#autoReadIncoming=True/False` - Auto-read new text - `speech#auto_read_incoming=True/False` - Auto-read new text
*Sound Settings:* *Sound Settings:*
- `sound#enabled=True/False` - Enable/disable sound - `sound#enabled=True/False` - Enable/disable sound
@@ -430,32 +430,32 @@ setting <action> [parameters]
- `sound#theme=theme_name` - Sound theme - `sound#theme=theme_name` - Sound theme
*General Settings:* *General Settings:*
- `general#punctuationLevel=none/some/most/all` - Punctuation verbosity - `general#punctuation_level=none/some/most/all` - Punctuation verbosity
- `general#debugLevel=0-3` - Debug level - `general#debug_level=0-3` - Debug level
- `general#emoticons=True/False` - Enable emoticon replacement - `general#emoticons=True/False` - Enable emoticon replacement
- `general#autoSpellCheck=True/False` - Automatic spell checking - `general#auto_spell_check=True/False` - Automatic spell checking
*Focus Settings:* *Focus Settings:*
- `focus#cursor=True/False` - Follow text cursor - `focus#cursor=True/False` - Follow text cursor
- `focus#highlight=True/False` - Follow text highlighting - `focus#highlight=True/False` - Follow text highlighting
*Keyboard Settings:* *Keyboard Settings:*
- `keyboard#charEchoMode=0-2` - Character echo (0=none, 1=always, 2=capslock only) - `keyboard#char_echo_mode=0-2` - Character echo (0=none, 1=always, 2=capslock only)
- `keyboard#wordEcho=True/False` - Echo complete words - `keyboard#word_echo=True/False` - Echo complete words
- `keyboard#charDeleteEcho=True/False` - Echo deleted characters - `keyboard#char_delete_echo=True/False` - Echo deleted characters
- `keyboard#interruptOnKeyPress=True/False` - Interrupt speech on key press - `keyboard#interrupt_on_key_press=True/False` - Interrupt speech on key press
*Screen Settings:* *Screen Settings:*
- `screen#ignoreScreen=1,2,3` - TTY screens to ignore - `screen#ignore_screen=1,2,3` - TTY screens to ignore
- `screen#autodetectIgnoreScreen=True/False` - Auto-detect screens to ignore - `screen#autodetect_ignore_screen=True/False` - Auto-detect screens to ignore
- `screen#screenUpdateDelay=float` - Screen update delay - `screen#screen_update_delay=float` - Screen update delay
*Time Settings:* *Time Settings:*
- `time#enabled=True/False` - Enable time announcements - `time#enabled=True/False` - Enable time announcements
- `time#presentTime=True/False` - Announce time - `time#present_time=True/False` - Announce time
- `time#presentDate=True/False` - Announce date changes - `time#present_date=True/False` - Announce date changes
- `time#delaySec=seconds` - Announcement interval - `time#delay_sec=seconds` - Announcement interval
- `time#onMinutes=00,30` - Specific minutes to announce - `time#on_minutes=00,30` - Specific minutes to announce
## Table Navigation ## Table Navigation
@@ -623,7 +623,7 @@ rsync -av source/ destination/ # File synchronization
### Customization ### Customization
Progress monitoring can be configured through settings: Progress monitoring can be configured through settings:
- **Default enabled**: Set `progressMonitoring=True` in sound section - **Default enabled**: Set `progress_monitoring=True` in sound section
- **Sound integration**: Works with all sound drivers (sox, gstreamer) - **Sound integration**: Works with all sound drivers (sox, gstreamer)
- **Remote control**: Enable/disable through remote commands - **Remote control**: Enable/disable through remote commands
@@ -677,8 +677,8 @@ send_fenrir_command("setting set speech#rate=0.9")
- TCP driver binds only to localhost (127.0.0.1) - TCP driver binds only to localhost (127.0.0.1)
- Socket file permissions are set to write-only (0o222) - Socket file permissions are set to write-only (0o222)
- Commands are processed with Fenrir's privileges - Commands are processed with Fenrir's privileges
- Settings changes can be disabled via `enableSettingsRemote=False` - Settings changes can be disabled via `enable_settings_remote=False`
- Command execution can be disabled via `enableCommandRemote=False` - Command execution can be disabled via `enable_command_remote=False`
### Troubleshooting ### Troubleshooting
@@ -688,7 +688,7 @@ send_fenrir_command("setting set speech#rate=0.9")
- Ensure remote driver is enabled in settings - Ensure remote driver is enabled in settings
**Commands not working:** **Commands not working:**
- Verify `enableCommandRemote=True` in settings - Verify `enable_command_remote=True` in settings
- Check Fenrir debug logs: `/var/log/fenrir.log` - Check Fenrir debug logs: `/var/log/fenrir.log`
- Test with simple command: `echo "command interrupt" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock` - Test with simple command: `echo "command interrupt" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock`
@@ -710,7 +710,7 @@ fenrir [OPTIONS]
- `-p, --print` - Print debug messages to screen - `-p, --print` - Print debug messages to screen
- `-e, --emulated-pty` - Use PTY emulation with escape sequences for input (enables desktop/X/Wayland usage) - `-e, --emulated-pty` - Use PTY emulation with escape sequences for input (enables desktop/X/Wayland usage)
- `-E, --emulated-evdev` - Use PTY emulation with evdev for input (single instance) - `-E, --emulated-evdev` - Use PTY emulation with evdev for input (single instance)
- `-F, --force-all-screens` - Force Fenrir to respond on all screens, ignoring ignoreScreen setting - `-F, --force-all-screens` - Force Fenrir to respond on all screens, ignoring ignore_screen setting
- `-i, -I, --ignore-screen SCREEN` - Ignore specific screen(s). Can be used multiple times. Combines with existing ignore settings. - `-i, -I, --ignore-screen SCREEN` - Ignore specific screen(s). Can be used multiple times. Combines with existing ignore settings.
### Examples: ### Examples:
@@ -724,7 +724,7 @@ sudo fenrir -e
# Override settings via command line # Override settings via command line
sudo fenrir -o "speech#rate=0.8;sound#volume=0.5" sudo fenrir -o "speech#rate=0.8;sound#volume=0.5"
# Force Fenrir to work on all screens (ignore ignoreScreen setting) # Force Fenrir to work on all screens (ignore ignore_screen setting)
sudo fenrir -F sudo fenrir -F
# Ignore specific screens # Ignore specific screens
+147 -105
View File
@@ -3,14 +3,13 @@
enabled=True enabled=True
# Select the driver used to play sounds, choices are genericDriver and gstreamerDriver. # Select the driver used to play sounds, choices are genericDriver and gstreamerDriver.
# Generic driver uses fewer dependencies but spawns a process for each sound played including progress bar beeps
# Gstreamer is the default. # Gstreamer is the default.
driver=gstreamerDriver driver=gstreamerDriver
#driver=genericDriver #driver=genericDriver
# Sound themes. These are the pack of sounds used for sound alerts. # Sound themes. These are the pack of sounds used for sound alerts.
# Sound packs may be located at /usr/share/sounds # Sound packs may be located at /usr/share/sounds
# For system wide availability, or ~/.local/share/fenrirscreenreader/sounds
# For the current user.
theme=default theme=default
# Sound volume controls how loud the sounds for your selected soundpack are. # Sound volume controls how loud the sounds for your selected soundpack are.
@@ -24,12 +23,12 @@ volume=0.7
# fenrirFrequence = the frequency to play # fenrirFrequence = the frequency to play
# fenrirDuration = the duration of the frequency # fenrirDuration = the duration of the frequency
# the following command is used to play a soundfile # the following command is used to play a soundfile
genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile generic_play_file_command=play -q -v fenrirVolume fenrirSoundFile
#the following command is used to generate a frequency beep #the following command is used to generate a frequency beep
genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence generic_frequency_command=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence
# Enable progress bar monitoring with ascending tones by default # Enable progress bar monitoring with ascending tones by default
progressMonitoring=True progress_monitoring=True
[speech] [speech]
# Turn speech on or off: # Turn speech on or off:
@@ -45,7 +44,13 @@ rate=0.5
# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. # Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest.
pitch=0.5 pitch=0.5
# Pitch for capital letters # Pitch for capital letters
capitalPitch=0.9 capital_pitch=0.9
# How to indicate capital letters:
# pitch = change speech pitch (uses capital_pitch value)
# beep = play Caps.wav sound icon
# both = play beep AND change pitch
# none = no special indication
capital_indicator=pitch
# Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest. # Volume controls the loudness of the voice, select from 0, quietest, to 1.0, loudest.
volume=1.0 volume=1.0
@@ -65,10 +70,10 @@ volume=1.0
#language=en #language=en
# Read new text as it happens? # Read new text as it happens?
autoReadIncoming=True auto_read_incoming=True
# Speak individual numbers instead of whole string. # Speak individual numbers instead of whole string.
readNumbersAsDigits = False read_numbers_as_digits = False
# genericSpeechCommand is the command that is executed for talking # genericSpeechCommand is the command that is executed for talking
# the following variables are replaced with values # the following variables are replaced with values
@@ -81,105 +86,134 @@ readNumbersAsDigits = False
# fenrirVolume = is replaced with the current volume # fenrirVolume = is replaced with the current volume
# fenrirPitch = is replaced with the current pitch # fenrirPitch = is replaced with the current pitch
# fenrirRate = is replaced with the current speed (speech rate) # fenrirRate = is replaced with the current speed (speech rate)
genericSpeechCommand=espeak-ng -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText" generic_speech_command=espeak-ng -a fenrir_volume -s fenrir_rate -p fenrir_pitch -v fenrir_voice -- "fenrir_text"
# min and max values of the TTS system that is used in genericSpeechCommand # min and max values of the TTS system that is used in generic_speech_command
fenrirMinVolume=0 fenrir_min_volume=0
fenrirMaxVolume=200 fenrir_max_volume=200
fenrirMinPitch=0 fenrir_min_pitch=0
fenrirMaxPitch=99 fenrir_max_pitch=99
fenrirMinRate=80 fenrir_min_rate=80
fenrirMaxRate=450 fenrir_max_rate=450
[screen] [screen]
# Screen driver: vcsaDriver (Linux TTY/virtual console), ptyDriver (terminal emulation)
driver=vcsaDriver driver=vcsaDriver
# Text encoding: auto (auto-detect), utf-8, latin1, etc.
encoding=auto encoding=auto
screenUpdateDelay=0.05 # Delay in seconds between screen updates (lower = more responsive, higher = less CPU)
ignoreScreen=7 # Recommended: 0.05 for most systems
autodetectIgnoreScreen=True screen_update_delay=0.05
# TTY number to completely ignore (e.g., 7 for X11/graphical login screen)
ignore_screen=7
# Automatically detect and ignore graphical TTYs (X11, Wayland sessions)
autodetect_ignore_screen=True
[keyboard] [keyboard]
driver=evdevDriver driver=evdevDriver
# filter input devices NOMICE, ALL or a DEVICE NAME # filter input devices NOMICE, ALL or a DEVICE NAME
device=ALL device=ALL
# gives Fenrir exclusive access to the keyboard and lets it control keystrokes. # gives Fenrir exclusive access to the keyboard and lets it control keystrokes.
grabDevices=True grab_devices=True
ignoreShortcuts=False # Ignore shortcut bindings and pass all keys through without processing Fenrir commands.
# When True, Fenrir will only monitor screen content without intercepting keyboard input.
# the current shortcut layout located in /etc/fenrirscreenreader/keyboard # the current shortcut layout located in /etc/fenrirscreenreader/keyboard
keyboardLayout=desktop ignore_shortcuts=False
keyboard_layout=desktop
# echo chars while typing. # echo chars while typing.
# 0 = None # 0 = None
# 1 = always # 1 = always
# 2 = only while capslock (not compatible with capslock as fenrir key) # 2 = only while capslock (not compatible with capslock as fenrir key)
charEchoMode=1 char_echo_mode=1
# echo deleted chars # echo deleted chars
charDeleteEcho=True char_delete_echo=True
# echo word after pressing space # echo word after pressing space
wordEcho=False word_echo=False
# interrupt speech on any keypress # interrupt speech on any keypress
interruptOnKeyPress=True interrupt_on_key_press=True
# you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys) # you can filter the keys on that the speech should interrupt (empty = all keys, otherwhise the given keys)
interruptOnKeyPressFilter= interrupt_on_key_press_filter=
# timeout for double tap in sec # timeout for double tap in sec
doubleTapTimeout=0.2 double_tap_timeout=0.2
[general] [general]
# Debug levels: 0=DEACTIVE, 1=ERROR, 2=WARNING, 3=INFO (most verbose) # Debug levels: 0=DEACTIVE, 1=ERROR, 2=WARNING, 3=INFO (most verbose)
# For production use, WARNING (2) provides good balance of useful info without spam # For production use, WARNING (2) provides good balance of useful info without spam
debugLevel=2 debug_level=2
# debugMode sets where the debug output should send to: # debugMode sets where the debug output should send to:
# debugMode=File writes to debugFile (Default:/tmp/fenrir-PID.log) # debugMode=File writes to debug_file (Default:/tmp/fenrir-PID.log)
# debugMode=Print just prints on the screen # debugMode=Print just prints on the screen
debugMode=File debug_mode=File
debugFile= debug_file=
punctuationProfile=default # Punctuation settings control how punctuation is spoken during text review.
punctuationLevel=some # Profile selects a punctuation definition file from config/punctuation/ (e.g., default.conf)
respectPunctuationPause=True punctuation_profile=default
punctuation_level=some
respect_punctuation_pause=True
# Replace undefined punctuation with spaces instead of removing them # Replace undefined punctuation with spaces instead of removing them
# This improves readability of text with punctuation like [X]mute, IP addresses, etc. # This improves readability of text with punctuation like [X]mute, IP addresses, etc.
replaceUndefinedPunctuationWithSpace=True replace_undefined_punctuation_with_space=True
newLinePause=True # Pause speech briefly at newline characters for better readability
numberOfClipboards=50 new_line_pause=True
number_of_clipboards=50
# used path for "export_clipboard_to_file" # used path for "export_clipboard_to_file"
# $user is replaced by username # $user is replaced by username
#clipboardExportPath=/home/$user/fenrirClipboard #clipboardExportPath=/home/$user/fenrirClipboard
clipboardExportPath=/tmp/fenrirClipboard clipboard_export_path=/tmp/fenrirClipboard
# Convert text emoticons like :) to descriptive text (e.g., "smiling face")
emoticons=True emoticons=True
# define the current Fenrir key # Define the Fenrir modifier key(s) - used to trigger Fenrir commands
fenrirKeys=KEY_KP0,KEY_META,KEY_INSERT # Examples: KEY_KP0 (numpad 0), KEY_META (Super/Windows), KEY_INSERT
scriptKeys=KEY_COMPOSE # Multiple keys: KEY_KP0,KEY_META,KEY_INSERT
timeFormat=%%I:%%M%%P fenrir_keys=KEY_KP0,KEY_META,KEY_INSERT
dateFormat=%%A, %%B %%d, %%Y # Script key - used to execute custom scripts in script_path
autoSpellCheck=True script_keys=KEY_COMPOSE
spellCheckLanguage=en_US # Time format using Python strftime codes (https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior)
# path for your scripts "scriptKeys" functionality # Default: %%I:%%M%%P (12-hour format, e.g., "06:38pm")
scriptPath=/usr/share/fenrirscreenreader/scripts # 24-hour format: %%H:%%M (e.g., "18:38")
# overload commands, and create new one without changing Fenrir default # Common codes: %%I=12hr hour, %%H=24hr hour, %%M=minute, %%S=second, %%P=am/pm lowercase, %%p=AM/PM uppercase
commandPath= time_format=%%I:%%M%%P
#fenrirBGColor = the backgroundcolor # Date format using Python strftime codes
#fenrirFGColor = the foregroundcolor # Default: %%A, %%B %%d, %%Y (e.g., "Tuesday, December 10, 2024")
#fenrirUnderline = speak the underline attribute # ISO format: %%Y-%%m-%%d (e.g., "2024-12-10")
#fenrirBold = speak the bold attribute # Common codes: %%A=weekday name, %%B=month name, %%d=day, %%Y=year with century, %%m=month number
#fenrirBlink = speak the blink attribute date_format=%%A, %%B %%d, %%Y
#fenrirFont = the font # Automatically spell check words when reviewing character-by-character
#fenrirFontSize = the fontsize auto_spell_check=True
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize # Language for spell checking (format: language_COUNTRY, e.g., en_US, en_GB, es_ES)
# present indentation spell_check_language=en_US
autoPresentIndent=False # path for your scripts "script_keys" functionality
# speak is only invoked on changeing ident level, sound always script_path=/usr/share/fenrirscreenreader/scripts
# 0 = sound and speak # Override default commands or add custom commands without modifying Fenrir installation
# 1 = sound only # Leave empty to use default commands only
# 2 = speak only command_path=
autoPresentIndentMode=1 # Format string for announcing text attributes (colors, formatting)
# play a sound when attributes change # Available variables:
hasAttributes=True # fenrirBGColor = the background color
# shell for PTY emulatiun (empty = default shell) # fenrirFGColor = the foreground color
# fenrirUnderline = speak the underline attribute
# fenrirBold = speak the bold attribute
# fenrirBlink = speak the blink attribute
# fenrirFont = the font name
# fenrirFontSize = the font size
attribute_format_string=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
# Automatically announce indentation level changes (useful for Python, YAML, etc.)
auto_present_indent=False
# How to present indentation changes:
# 0 = sound and speak (both audio feedback and voice announcement)
# 1 = sound only (just play a tone)
# 2 = speak only (just voice announcement)
auto_present_indent_mode=1
# Play a sound when text attributes (color, bold, etc.) change
has_attributes=True
# Shell to use for PTY emulation mode (empty = use system default shell)
# Examples: /bin/bash, /bin/zsh, /usr/bin/fish
shell= shell=
[focus] [focus]
#follow the text cursor # Follow and announce text cursor position changes
cursor=True cursor=True
#follow highlighted text changes # Follow and announce highlighted/selected text changes (useful in menus)
highlight=False highlight=False
[remote] [remote]
@@ -191,40 +225,43 @@ driver=unixDriver
# tcp port # tcp port
port=22447 port=22447
# socket filepath # socket filepath
socketFile= socket_file=
# allow settings to overwrite # allow settings to overwrite
enableSettingsRemote=True enable_settings_remote=True
# allow commands to be executed # allow commands to be executed
enableCommandRemote=True enable_command_remote=True
[barrier] [barrier]
# Enable barrier detection - automatically detects table/box borders for improved navigation
enabled=False enabled=False
leftBarriers=│└┌─ # Characters that represent left-side barriers/borders (for table/box detection)
rightBarriers=│┘┐ left_barriers=│└┌
# Characters that represent right-side barriers/borders (for table/box detection)
right_barriers=│┘┐─
[review] [review]
lineBreak=True # Announce line breaks during review mode
endOfScreen=True line_break=True
# leave the review when pressing a key # Announce when reaching the end of screen during review
leaveReviewOnCursorChange=True end_of_screen=True
# leave the review when changing the screen # Exit review mode when cursor position changes (e.g., when typing)
leaveReviewOnScreenChange=True leave_review_on_cursor_change=True
# Exit review mode when switching to a different TTY/screen
[promote] leave_review_on_screen_change=True
enabled=True
inactiveTimeoutSec=120
list=
[menu] [menu]
vmenuPath= # Custom path for VMenu (virtual menu) profiles
# quickMenu: Semicolon-separated list of settings for quick adjustment # Leave empty to use default location (/etc/fenrirscreenreader/vmenu-profiles/)
vmenu_path=
# Quick menu: Semicolon-separated list of settings for rapid adjustment via VMenu
# Access with Fenrir+F10, navigate to "Quick Settings"
# Format: section#setting;section#setting;... # Format: section#setting;section#setting;...
# Supported settings: # Supported settings:
# - speech#rate, speech#pitch, speech#volume (0.0-1.0) # - speech#rate, speech#pitch, speech#volume (0.0-1.0)
# - speech#module, speech#voice (speechdDriver only, auto-added) # - speech#module, speech#voice (speechdDriver only, auto-added)
# Note: speech#module and speech#voice are automatically added when # Note: speech#module and speech#voice are automatically added when
# speechdDriver is active. Do not add them manually. # speechdDriver is active. Do not add them manually.
quickMenu=speech#rate;speech#pitch;speech#volume quick_menu=speech#rate;speech#pitch;speech#volume
[prompt] [prompt]
# Custom prompt patterns for silence until prompt feature # Custom prompt patterns for silence until prompt feature
@@ -242,27 +279,32 @@ quickMenu=speech#rate;speech#pitch;speech#volume
# For "[user@hostname ~] $" use: \[.*@.*\s.*\]\s*[$#>]\s* # For "[user@hostname ~] $" use: \[.*@.*\s.*\]\s*[$#>]\s*
# For custom prompts ending with specific strings, use patterns like: .*your_prompt_ending$ # For custom prompts ending with specific strings, use patterns like: .*your_prompt_ending$
# For custom package manager prompts: .*your_package_manager.*\[[YyNn]/[YyNn]\].* # For custom package manager prompts: .*your_package_manager.*\[[YyNn]/[YyNn]\].*
customPatterns= custom_patterns=
# Specific prompt strings to match exactly (useful for very specific custom prompts) # Specific prompt strings to match exactly (useful for very specific custom prompts)
# Format: exactMatches=prompt1,prompt2,prompt3 # Format: exact_matches=prompt1,prompt2,prompt3
# Examples: # Examples:
# exactMatches=[storm@fenrir ~] $,[root@fenrir ~] #,Continue installation? [Y/n] # exact_matches=[storm@fenrir ~] $,[root@fenrir ~] #,Continue installation? [Y/n]
exactMatches= exact_matches=
[time] [time]
# automatic time announcement # Enable automatic time announcements
enabled=False enabled=False
# present time # Announce the current time
presentTime=True present_time=True
# present date (on change) # Announce the date (only when it changes, e.g., at midnight)
presentDate=True present_date=True
# present time after a given period of seconds # Announce time every N seconds (0 = disabled)
delaySec=0 # If delay_sec > 0, on_minutes is ignored
# present time after to given minutes example every 15 minutes: 00,15,30,45 delay_sec=0
# if delaySec is >0 onMinutes is ignored # Announce time at specific minutes of each hour (comma-separated)
onMinutes=00,30 # Examples:
# announce via soundicon (not interrupting) # 00 = Only on the hour (1:00, 2:00, 3:00, etc.)
# 00,30 = On the hour and half-hour (1:00, 1:30, 2:00, 2:30, etc.)
# 00,15,30,45 = Every 15 minutes
# Note: This is ignored if delay_sec > 0
on_minutes=00,30
# Play a sound icon before time announcement (non-interrupting)
announce=True announce=True
# interrupt current speech for time announcement # Interrupt current speech to announce time immediately
interrupt=False interrupt=False
Binary file not shown.
-2
View File
@@ -46,8 +46,6 @@ ErrorSpeech='ErrorSpeech.wav'
ErrorScreen='ErrorScreen.wav' ErrorScreen='ErrorScreen.wav'
# If you cursor over an text that has attributs (like color) # If you cursor over an text that has attributs (like color)
HasAttributes='has_attribute.wav' HasAttributes='has_attribute.wav'
# fenrir can promote strings if they appear on the screen.
PromotedText='PromotedText.wav'
# missspelled indicator # missspelled indicator
mispell='mispell.wav' mispell='mispell.wav'
# the for capital letter # the for capital letter
-2
View File
@@ -50,8 +50,6 @@ ErrorBraille=''
ErrorScreen='' ErrorScreen=''
# If you cursor over an text that has attributs (like color) # If you cursor over an text that has attributs (like color)
HasAttributes='' HasAttributes=''
# fenrir can promote strings if they appear on the screen.
PromotedText=''
# misspelled indicator # misspelled indicator
mispell='' mispell=''
# the for capital letter: # the for capital letter:
+33 -83
View File
@@ -1095,23 +1095,6 @@ announce=True
interrupt=False interrupt=False
.... ....
==== Promoted List
Promoted Lists are a nice feature if you are away from your computer or
performing more longer tasks. you can define a list of words which you
want to hear a sound icon for after a period of inactivity. Example if
the word "Chrys" appears after 120 Seconds of inactivity:
....
[promote]
enabled=True
inactiveTimeoutSec=120
list=Chrys
....
See section link:#Promote[Promote] in `+settings.conf+` for more
information.
=== Dictionary === Dictionary
You can make use of different kinds of built-in dictionary's. A You can make use of different kinds of built-in dictionary's. A
@@ -1286,8 +1269,8 @@ Enable remote control in settings.conf:
[remote] [remote]
enable=True enable=True
driver=unixDriver driver=unixDriver
enableSettingsRemote=True enable_settings_remote=True
enableCommandRemote=True enable_command_remote=True
.... ....
==== Using socat with Unix Sockets ==== Using socat with Unix Sockets
@@ -1317,13 +1300,13 @@ echo "setting set focus#highlight=True" | socat - UNIX-CLIENT:/tmp/fenrirscreenr
echo "setting set speech#rate=0.8" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#rate=0.8" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Change punctuation level (none/some/most/all) # Change punctuation level (none/some/most/all)
echo "setting set general#punctuationLevel=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set general#punctuation_level=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Voice and TTS control # Voice and TTS control
echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Multiple settings at once # Multiple settings at once
echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuationLevel=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuation_level=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Reset all settings to defaults # Reset all settings to defaults
echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
@@ -1394,8 +1377,8 @@ echo "command quitapplication" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-dea
* `+speech#module=module_name+` - TTS module (e.g., "espeak-ng") * `+speech#module=module_name+` - TTS module (e.g., "espeak-ng")
*General Settings:* *General Settings:*
* `+general#punctuationLevel=none/some/most/all+` - Punctuation verbosity * `+general#punctuation_level=none/some/most/all+` - Punctuation verbosity
* `+general#autoSpellCheck=True/False+` - Automatic spell checking * `+general#auto_spell_check=True/False+` - Automatic spell checking
* `+general#emoticons=True/False+` - Enable emoticon replacement * `+general#emoticons=True/False+` - Enable emoticon replacement
*Sound Settings:* *Sound Settings:*
@@ -1407,11 +1390,11 @@ echo "command quitapplication" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-dea
* `+focus#highlight=True/False+` - Follow text highlighting * `+focus#highlight=True/False+` - Follow text highlighting
*Keyboard Settings:* *Keyboard Settings:*
* `+keyboard#charEchoMode=0-2+` - Character echo (0=none, 1=always, 2=capslock only) * `+keyboard#char_echo_mode=0-2+` - Character echo (0=none, 1=always, 2=capslock only)
* `+keyboard#wordEcho=True/False+` - Echo complete words * `+keyboard#word_echo=True/False+` - Echo complete words
*Screen Settings:* *Screen Settings:*
* `+screen#ignoreScreen=1,2,3+` - TTY screens to ignore * `+screen#ignore_screen=1,2,3+` - TTY screens to ignore
==== settings.conf syntax ==== settings.conf syntax
@@ -1511,14 +1494,14 @@ frequencies.
sound file. sound file.
.... ....
genericPlayFileCommand=<your command for playing a file> generic_play_file_command=<your command for playing a file>
.... ....
`+genericFrequencyCommand+` defines the command that is used playing `+genericFrequencyCommand+` defines the command that is used playing
frequencies. frequencies.
.... ....
genericFrequencyCommand=<your command for playing a frequence> generic_frequency_command=<your command for playing a frequence>
.... ....
The following variables are substituted in `+genericPlayFileCommand+` The following variables are substituted in `+genericPlayFileCommand+`
@@ -1532,13 +1515,13 @@ and `+genericFrequencyCommand+`:
Example genericPlayFileCommand (default) Example genericPlayFileCommand (default)
.... ....
genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile generic_play_file_command=play -q -v fenrirVolume fenrirSoundFile
.... ....
Example genericFrequencyCommand (default) Example genericFrequencyCommand (default)
.... ....
genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence generic_frequency_command=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence
.... ....
==== Speech ==== Speech
@@ -1579,7 +1562,7 @@ Values: Range Minimum:`+0.0+` is lowest, Maximum:`+1.0+` is highest.
A Pitch for capital letters can be set. A Pitch for capital letters can be set.
.... ....
capitalPitch=0.9 capital_pitch=0.9
.... ....
Values: Range Minimum:`+0.0+` is lowest, Maximum:`+1.0+` is highest. Values: Range Minimum:`+0.0+` is lowest, Maximum:`+1.0+` is highest.
@@ -1681,7 +1664,7 @@ the pico module:
language=de-DE language=de-DE
.... ....
Read new text as it occurs autoReadIncoming=True Values: on=`+True+`, Read new text as it occurs auto_read_incoming=True Values: on=`+True+`,
off=`+False+` off=`+False+`
==== Screen ==== Screen
@@ -1711,7 +1694,7 @@ Values:`+cp850+` is used for Western languages like USA or Europe.
The driver updates Fenrir with changes on the screen. The driver updates Fenrir with changes on the screen.
.... ....
screenUpdateDelay=0.05 screen_update_delay=0.05
.... ....
Values: in Seconds Values: in Seconds
@@ -1776,7 +1759,7 @@ Gives Fenrir exclusive access to the keyboard and lets it control
keystrokes. This is needed to intercept Fenrir related shortcuts. keystrokes. This is needed to intercept Fenrir related shortcuts.
.... ....
grabDevices=True grab_devices=True
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1785,7 +1768,7 @@ The following makes sense if you are using a second screenreader and
want to have some hooked events. Fenrir ignores all shortcuts then. want to have some hooked events. Fenrir ignores all shortcuts then.
.... ....
ignoreShortcuts=False ignore_shortcuts=False
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1793,7 +1776,7 @@ Values: on=`+True+`, off=`+False+`
The current keyboard layout used for shortcuts. The current keyboard layout used for shortcuts.
.... ....
keyboardLayout=desktop keyboard_layout=desktop
.... ....
Values: An absolute Path to a Keyboard definition file or a Filename Values: An absolute Path to a Keyboard definition file or a Filename
@@ -1810,7 +1793,7 @@ Values: on=`+True+`, off=`+False+`
Announce deleted characters Announce deleted characters
.... ....
charDeleteEcho=True char_delete_echo=True
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1818,7 +1801,7 @@ Values: on=`+True+`, off=`+False+`
Announce word after pressing space Announce word after pressing space
.... ....
wordEcho=False word_echo=False
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1826,7 +1809,7 @@ Values: on=`+True+`, off=`+False+`
Interrupt speech on any keypress Interrupt speech on any keypress
.... ....
interruptOnKeyPress=False interrupt_on_key_press=False
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1834,7 +1817,7 @@ Values: on=`+True+`, off=`+False+`
You can filter the keys that speech should interrupt You can filter the keys that speech should interrupt
.... ....
interruptOnKeyPressFilter= interrupt_on_key_press_filter=
.... ....
Values: (List) empty = all keys, otherwise interrupt with specified keys Values: (List) empty = all keys, otherwise interrupt with specified keys
@@ -1842,7 +1825,7 @@ Values: (List) empty = all keys, otherwise interrupt with specified keys
The timeout that is used for double tap shortcuts The timeout that is used for double tap shortcuts
.... ....
doubleTapTimeout=0.2 double_tap_timeout=0.2
.... ....
Values: Seconds Values: Seconds
@@ -1862,7 +1845,7 @@ Values: off=0, error=1, warning=2, info=3
the current punctuation and dict file in use: the current punctuation and dict file in use:
.... ....
punctuationProfile=default punctuation_profile=default
.... ....
Values: Text, see available profiles in `+/etc/fenrir/punctuation+` or Values: Text, see available profiles in `+/etc/fenrir/punctuation+` or
@@ -1871,7 +1854,7 @@ in `+sourceTree/config/punctuation+`
The current punctuation level in use: The current punctuation level in use:
.... ....
punctuationLevel=some punctuation_level=some
.... ....
Values: Text, See available levels in the used punctuation file. Values: Text, See available levels in the used punctuation file.
@@ -1879,7 +1862,7 @@ Values: Text, See available levels in the used punctuation file.
Respect pause for punctuations: Respect pause for punctuations:
.... ....
respectPunctuationPause=True respect_punctuation_pause=True
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1887,7 +1870,7 @@ Values: on=`+True+`, off=`+False+`
Add a pause on Line break: Add a pause on Line break:
.... ....
newLinePause=True new_line_pause=True
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1905,7 +1888,7 @@ Values: Text, Systemfilepath
The number of available clipboards: The number of available clipboards:
.... ....
numberOfClipboards=10 number_of_clipboards=10
.... ....
Values: Integer, 1 - 999 Values: Integer, 1 - 999
@@ -1921,7 +1904,7 @@ Values: on=`+True+`, off=`+False+`
Define the current Fenrir keys: Define the current Fenrir keys:
.... ....
fenrirKeys=KEY_KP0,KEY_META,KEY_INSERT fenrir_keys=KEY_KP0,KEY_META,KEY_INSERT
.... ....
Values, Text list, separated by comma. Values, Text list, separated by comma.
@@ -1955,7 +1938,7 @@ https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior[d
Enable or Disable spellcheck whilst typing: Enable or Disable spellcheck whilst typing:
.... ....
autoSpellCheck=True auto_spell_check=True
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
@@ -1963,7 +1946,7 @@ Values: on=`+True+`, off=`+False+`
The use of the dictionary with spellcheck: The use of the dictionary with spellcheck:
.... ....
spellCheckLanguage=en_US spell_check_language=en_US
.... ....
Values: Text, see aspell dictionary's. Values: Text, see aspell dictionary's.
@@ -2044,44 +2027,11 @@ Values: on=`+True+`, off=`+False+`
Leave the review mode when changing the screen (From TTY3 to TTY4): Leave the review mode when changing the screen (From TTY3 to TTY4):
.... ....
leaveReviewOnScreenChange=True leave_review_on_screen_change=True
.... ....
Values: on=`+True+`, off=`+False+` Values: on=`+True+`, off=`+False+`
==== Promote
"Promoted Lists" are configured in the section `+[promote]+`. Turn
Promoted Lists" on or off:
....
enabled=True
....
Values: on=`+True+`, off=`+False+`
The minimum time interval of inactivity to activate promoting. By
default it promotes after 120 Seconds inactivity:
....
inactiveTimeoutSec=120
....
Values: in Seconds
Define a list of promoted words comma seperated:
....
list=
....
Values: text (comma seperated) Example to promote the word "nickname" or
a bash prompt:
....
list=nickname,$:,#:
....
==== Time ==== Time
The automated time announcement is configured in the section `+[time]+`. The automated time announcement is configured in the section `+[time]+`.
+11 -11
View File
@@ -102,17 +102,17 @@ volume=0.7
[keyboard] [keyboard]
driver=evdevDriver driver=evdevDriver
keyboardLayout=desktop keyboard_layout=desktop
[screen] [screen]
driver=vcsaDriver driver=vcsaDriver
ignoreScreen= ignore_screen=
[remote] [remote]
enable=True enable=True
driver=unixDriver driver=unixDriver
enableSettingsRemote=True enable_settings_remote=True
enableCommandRemote=True enable_command_remote=True
``` ```
## Remote Control ## Remote Control
@@ -126,8 +126,8 @@ Enable remote control in settings:
enable=True enable=True
driver=unixDriver # or tcpDriver driver=unixDriver # or tcpDriver
port=22447 # for TCP driver port=22447 # for TCP driver
enableSettingsRemote=True # allow settings changes enable_settings_remote=True # allow settings changes
enableCommandRemote=True # allow command execution enable_command_remote=True # allow command execution
``` ```
### Basic Usage with socat ### Basic Usage with socat
@@ -155,14 +155,14 @@ echo "setting set speech#pitch=0.6" | socat - UNIX-CLIENT:/tmp/fenrirscreenreade
echo "setting set speech#volume=0.9" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#volume=0.9" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Change punctuation level (none/some/most/all) # Change punctuation level (none/some/most/all)
echo "setting set general#punctuationLevel=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set general#punctuation_level=all" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Voice and TTS control # Voice and TTS control
echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#voice=en-us+f3" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
echo "setting set speech#module=espeak-ng" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#module=espeak-ng" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Multiple settings at once # Multiple settings at once
echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuationLevel=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting set speech#rate=0.8;sound#volume=0.7;general#punctuation_level=most" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
# Reset all settings # Reset all settings
echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock echo "setting reset" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
@@ -208,11 +208,11 @@ echo "command quitapplication" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-dea
- `command resetvmenu` - Reset virtual menu - `command resetvmenu` - Reset virtual menu
**Key Settings You Can Change:** **Key Settings You Can Change:**
- Punctuation level: `setting set general#punctuationLevel=all` - Punctuation level: `setting set general#punctuation_level=all`
- Speech parameters: `setting set speech#rate=0.8;speech#pitch=0.6` - Speech parameters: `setting set speech#rate=0.8;speech#pitch=0.6`
- Voice selection: `setting set speech#voice=en-us+f3` - Voice selection: `setting set speech#voice=en-us+f3`
- Character echo: `setting set keyboard#charEchoMode=1` - Character echo: `setting set keyboard#char_echo_mode=1`
- Screen ignore: `setting set screen#ignoreScreen=1,2,3` - Screen ignore: `setting set screen#ignore_screen=1,2,3`
### Scripting Integration ### Scripting Integration
+30 -56
View File
@@ -729,15 +729,6 @@ Example on fix minutes in an hour. example every quarter "delaySec=0" and "onMin
onMinutes=00,15,30,45 onMinutes=00,15,30,45
announce=True announce=True
interrupt=False interrupt=False
==== Promoted List ====
Promoted Lists are a nice feature if you are away from your computer or performing more longer tasks.
you can define a list of words which you want to hear a sound icon for after a period of inactivity.
Example if the word "Chrys" appears after 120 Seconds of inactivity:
[promote]
enabled=True
inactiveTimeoutSec=120
list=Chrys
See section [[#Promote|Promote]] in ''settings.conf'' for more information.
==== Punctuation ==== ==== Punctuation ====
Fenrir handles punctuation levels and names for you with several provided dictionaries. Fenrir handles punctuation levels and names for you with several provided dictionaries.
@@ -867,9 +858,9 @@ Values: ''0.0'' is quietest, ''1.0'' is loudest.
The generic sound driver uses shell commands for play sound and frequencies. The generic sound driver uses shell commands for play sound and frequencies.
''genericPlayFileCommand'' defines the command that is used to play a sound file. ''genericPlayFileCommand'' defines the command that is used to play a sound file.
genericPlayFileCommand=<your command for playing a file> generic_play_file_command=<your command for playing a file>
''genericFrequencyCommand'' defines the command that is used playing frequencies. ''genericFrequencyCommand'' defines the command that is used playing frequencies.
genericFrequencyCommand=<your command for playing a frequence> generic_frequency_command=<your command for playing a frequence>
The following variables are substituted in ''genericPlayFileCommand'' and ''genericFrequencyCommand'': The following variables are substituted in ''genericPlayFileCommand'' and ''genericFrequencyCommand'':
* ''fenrirVolume'' = the current volume setting * ''fenrirVolume'' = the current volume setting
@@ -878,9 +869,9 @@ The following variables are substituted in ''genericPlayFileCommand'' and ''gene
* ''fenrirDuration'' = the duration of the frequency * ''fenrirDuration'' = the duration of the frequency
Example genericPlayFileCommand (default) Example genericPlayFileCommand (default)
genericPlayFileCommand=play -q -v fenrirVolume fenrirSoundFile generic_play_file_command=play -q -v fenrirVolume fenrirSoundFile
Example genericFrequencyCommand (default) Example genericFrequencyCommand (default)
genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence generic_frequency_command=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence
==== Speech ==== ==== Speech ====
Speech is configured in section ''[speech]''. Speech is configured in section ''[speech]''.
Turn speech on or off: Turn speech on or off:
@@ -910,7 +901,7 @@ Pitch controls the pitch of the voice.
Values: Range Minimum:''0.0'' is lowest, Maximum:''1.0'' is highest. Values: Range Minimum:''0.0'' is lowest, Maximum:''1.0'' is highest.
A Pitch for capital letters can be set. A Pitch for capital letters can be set.
capitalPitch=0.9 capital_pitch=0.9
Values: Range Minimum:''0.0'' is lowest, Maximum:''1.0'' is highest. Values: Range Minimum:''0.0'' is lowest, Maximum:''1.0'' is highest.
The Volume controls the loudness of the voice. The Volume controls the loudness of the voice.
@@ -931,7 +922,7 @@ Select the language you want Fenrir to use.
Values: Text, see your TTS synths documentation what is available. Values: Text, see your TTS synths documentation what is available.
Read new text as it occurs Read new text as it occurs
autoReadIncoming=True auto_read_incoming=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
=== Generic Driver === === Generic Driver ===
@@ -948,16 +939,16 @@ The following variables are substituted in ''genericSpeechCommand'':
* ''fenrirRate'' = is replaced with the current speed (speech rate) * ''fenrirRate'' = is replaced with the current speed (speech rate)
Example genericSpeechCommand (default): Example genericSpeechCommand (default):
genericSpeechCommand=espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText" generic_speech_command=espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"
These are the minimum and maximum values of the TTS system used in genericSpeechCommand. They are needed to calculate the abstract range in volume, rate and pitch 0.0 - 1.0. These are the minimum and maximum values of the TTS system used in genericSpeechCommand. They are needed to calculate the abstract range in volume, rate and pitch 0.0 - 1.0.
FenrirMinVolume=0 FenrirMinVolume=0
fenrirMaxVolume=200 fenrir_max_volume=200
fenrirMinPitch=0 fenrir_min_pitch=0
fenrirMaxPitch=99 fenrir_max_pitch=99
fenrirMinRate=80 fenrir_min_rate=80
fenrirMaxRate=450 fenrir_max_rate=450
The current volume, pitch and rate is calculated like this The current volume, pitch and rate is calculated like this
value = min + [volume,pitch,rate] * (min - max ) value = min + [volume,pitch,rate] * (min - max )
@@ -1033,7 +1024,7 @@ The encoding of the screen
Values:''cp850'' is used for Western languages like USA or Europe. Values:''cp850'' is used for Western languages like USA or Europe.
The driver updates Fenrir with changes on the screen. The driver updates Fenrir with changes on the screen.
screenUpdateDelay=0.05 screen_update_delay=0.05
Values: in Seconds Values: in Seconds
If you want Fenrir to not be active on any screen for various reasons. Maybe an X server or Wayland is running on that screen. You can make Fenrir ignore it or multiple screens seperated by '','' with: If you want Fenrir to not be active on any screen for various reasons. Maybe an X server or Wayland is running on that screen. You can make Fenrir ignore it or multiple screens seperated by '','' with:
@@ -1064,15 +1055,15 @@ Values:
* ''<Device Name>'' just use the device with the given name. * ''<Device Name>'' just use the device with the given name.
Gives Fenrir exclusive access to the keyboard and lets it control keystrokes. This is needed to intercept Fenrir related shortcuts. Gives Fenrir exclusive access to the keyboard and lets it control keystrokes. This is needed to intercept Fenrir related shortcuts.
grabDevices=True grab_devices=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
The following makes sense if you are using a second screenreader and want to have some hooked events. Fenrir ignores all shortcuts then. The following makes sense if you are using a second screenreader and want to have some hooked events. Fenrir ignores all shortcuts then.
ignoreShortcuts=False ignore_shortcuts=False
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
The current keyboard layout used for shortcuts. The current keyboard layout used for shortcuts.
keyboardLayout=desktop keyboard_layout=desktop
Values: An absolute Path to a Keyboard definition file or a Filename without extension located in ''/etc/fenrir/keyboard'' Values: An absolute Path to a Keyboard definition file or a Filename without extension located in ''/etc/fenrir/keyboard''
Announce characters while typing. Announce characters while typing.
@@ -1080,23 +1071,23 @@ Announce characters while typing.
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Announce deleted characters Announce deleted characters
charDeleteEcho=True char_delete_echo=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Announce word after pressing space Announce word after pressing space
wordEcho=False word_echo=False
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Interrupt speech on any keypress Interrupt speech on any keypress
interruptOnKeyPress=False interrupt_on_key_press=False
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
You can filter the keys that speech should interrupt You can filter the keys that speech should interrupt
interruptOnKeyPressFilter= interrupt_on_key_press_filter=
Values: (List) empty = all keys, otherwise interrupt with specified keys Values: (List) empty = all keys, otherwise interrupt with specified keys
The timeout that is used for double tap shortcuts The timeout that is used for double tap shortcuts
doubleTapTimeout=0.2 double_tap_timeout=0.2
Values: Seconds Values: Seconds
==== General ==== ==== General ====
Overall settings can be configured from the section ''[general]''. Overall settings can be configured from the section ''[general]''.
@@ -1106,19 +1097,19 @@ Set the current debug level:
Values: off=0, error=1, warning=2, info=3 Values: off=0, error=1, warning=2, info=3
the current punctuation and dict file in use: the current punctuation and dict file in use:
punctuationProfile=default punctuation_profile=default
Values: Text, see available profiles in ''/etc/fenrir/punctuation'' or in ''sourceTree/config/punctuation'' Values: Text, see available profiles in ''/etc/fenrir/punctuation'' or in ''sourceTree/config/punctuation''
The current punctuation level in use: The current punctuation level in use:
punctuationLevel=some punctuation_level=some
Values: Text, See available levels in the used punctuation file. Values: Text, See available levels in the used punctuation file.
Respect pause for punctuations: Respect pause for punctuations:
respectPunctuationPause=True respect_punctuation_pause=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Add a pause on Line break: Add a pause on Line break:
newLinePause=True new_line_pause=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Specify the path where the clipboard should be exported to. Specify the path where the clipboard should be exported to.
@@ -1128,7 +1119,7 @@ The variable ''$user'' is replaced by the current logged username.
Values: Text, Systemfilepath Values: Text, Systemfilepath
The number of available clipboards: The number of available clipboards:
numberOfClipboards=10 number_of_clipboards=10
Values: Integer, 1 - 999 Values: Integer, 1 - 999
Replace emoticons like :) or ;) with text insertions: Replace emoticons like :) or ;) with text insertions:
@@ -1136,7 +1127,7 @@ Replace emoticons like :) or ;) with text insertions:
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Define the current Fenrir keys: Define the current Fenrir keys:
fenrirKeys=KEY_KP0,KEY_META,KEY_INSERT fenrir_keys=KEY_KP0,KEY_META,KEY_INSERT
Values, Text list, separated by comma. Values, Text list, separated by comma.
Define the current script keys: Define the current script keys:
@@ -1152,11 +1143,11 @@ The date format to be used for (date command) output:
Values: see python specification for [[https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior|datetime.strftime]] Values: see python specification for [[https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior|datetime.strftime]]
Enable or Disable spellcheck whilst typing: Enable or Disable spellcheck whilst typing:
autoSpellCheck=True auto_spell_check=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
The use of the dictionary with spellcheck: The use of the dictionary with spellcheck:
spellCheckLanguage=en_US spell_check_language=en_US
Values: Text, see aspell dictionary's. Values: Text, see aspell dictionary's.
Folder Path for your scripts "scriptKey" functionality: Folder Path for your scripts "scriptKey" functionality:
@@ -1197,25 +1188,8 @@ Leave the review mode when pressing a key:
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
Leave the review mode when changing the screen (From TTY3 to TTY4): Leave the review mode when changing the screen (From TTY3 to TTY4):
leaveReviewOnScreenChange=True leave_review_on_screen_change=True
Values: on=''True'', off=''False'' Values: on=''True'', off=''False''
==== Promote ====
"Promoted Lists" are configured in the section ''[promote]''.
Turn Promoted Lists" on or off:
enabled=True
Values: on=''True'', off=''False''
The minimum time interval of inactivity to activate promoting.
By default it promotes after 120 Seconds inactivity:
inactiveTimeoutSec=120
Values: in Seconds
Define a list of promoted words comma seperated:
list=
Values: text (comma seperated)
Example to promote the word "nickname" or a bash prompt:
list=nickname,$:,#:
==== Time ==== ==== Time ====
The automated time announcement is configured in the section ''[time]''. The automated time announcement is configured in the section ''[time]''.
Time announcement is disabled by default. Time announcement is disabled by default.
@@ -22,7 +22,7 @@ class command:
self.env["runtime"]["MemoryManager"].add_index_list( self.env["runtime"]["MemoryManager"].add_index_list(
"clipboardHistory", "clipboardHistory",
self.env["runtime"]["SettingsManager"].get_setting_as_int( 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): def update_spell_language(self):
self.spellChecker = enchant.Dict( self.spellChecker = enchant.Dict(
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
) )
self.language = self.env["runtime"]["SettingsManager"].get_setting( self.language = self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
def run(self): def run(self):
@@ -48,7 +48,7 @@ class command:
return return
if ( if (
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
!= self.language != self.language
): ):
@@ -59,7 +59,7 @@ class command:
def run(self): def run(self):
current_layout = self.env["runtime"]["SettingsManager"].get_setting( current_layout = self.env["runtime"]["SettingsManager"].get_setting(
"keyboard", "keyboardLayout" "keyboard", "keyboard_layout"
) )
# Extract layout name from full path if needed # Extract layout name from full path if needed
@@ -83,7 +83,7 @@ class command:
# Update setting and reload shortcuts # Update setting and reload shortcuts
self.env["runtime"]["SettingsManager"].set_setting( self.env["runtime"]["SettingsManager"].set_setting(
"keyboard", "keyboardLayout", next_layout "keyboard", "keyboard_layout", next_layout
) )
# Reload shortcuts with new layout # Reload shortcuts with new layout
@@ -26,7 +26,7 @@ class command:
def run(self): def run(self):
clipboard_file_path = self.env["runtime"][ clipboard_file_path = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("general", "clipboardExportPath") ].get_setting("general", "clipboard_export_path")
clipboard_file_path = clipboard_file_path.replace( clipboard_file_path = clipboard_file_path.replace(
"$user", self.env["general"]["curr_user"] "$user", self.env["general"]["curr_user"]
) )
@@ -22,7 +22,7 @@ class command:
return _("sends the following keypress to the terminal or application") return _("sends the following keypress to the terminal or application")
def run(self): def run(self):
self.env["input"]["keyForeward"] = 3 self.env["input"]["key_forward"] = 3
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("Forward next keypress"), interrupt=True _("Forward next keypress"), interrupt=True
) )
@@ -26,7 +26,7 @@ class command:
def run(self): def run(self):
clipboard_file_path = self.env["runtime"][ clipboard_file_path = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("general", "clipboardExportPath") ].get_setting("general", "clipboard_export_path")
clipboard_file_path = clipboard_file_path.replace( clipboard_file_path = clipboard_file_path.replace(
"$user", self.env["general"]["curr_user"] "$user", self.env["general"]["curr_user"]
) )
@@ -18,7 +18,7 @@ class command:
self.env["runtime"]["MemoryManager"].add_index_list( self.env["runtime"]["MemoryManager"].add_index_list(
"clipboardHistory", "clipboardHistory",
self.env["runtime"]["SettingsManager"].get_setting_as_int( self.env["runtime"]["SettingsManager"].get_setting_as_int(
"general", "numberOfClipboards" "general", "number_of_clipboards"
), ),
) )
@@ -18,17 +18,17 @@ class command:
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
# Use commandBuffer like other commands # 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 # Check if progress monitoring should be enabled by default from
# settings # settings
try: try:
default_enabled = self.env["runtime"][ default_enabled = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_bool("sound", "progressMonitoring") ].get_setting_as_bool("sound", "progress_monitoring")
except Exception as e: except Exception as e:
# If setting doesn't exist, default to False # If setting doesn't exist, default to False
default_enabled = 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"]["lastProgressTime"] = 0
self.env["commandBuffer"]["lastProgressValue"] = -1 self.env["commandBuffer"]["lastProgressValue"] = -1
@@ -40,12 +40,12 @@ class command:
def run(self): def run(self):
# Check if commandBuffer exists # Check if commandBuffer exists
if "progressMonitoring" not in self.env["commandBuffer"]: if "progress_monitoring" not in self.env["commandBuffer"]:
self.env["commandBuffer"]["progressMonitoring"] = False self.env["commandBuffer"]["progress_monitoring"] = False
self.env["commandBuffer"]["lastProgressTime"] = 0 self.env["commandBuffer"]["lastProgressTime"] = 0
self.env["commandBuffer"]["lastProgressValue"] = -1 self.env["commandBuffer"]["lastProgressValue"] = -1
if self.env["commandBuffer"]["progressMonitoring"]: if self.env["commandBuffer"]["progress_monitoring"]:
self.stop_progress_monitoring() self.stop_progress_monitoring()
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("Progress monitoring disabled"), interrupt=True _("Progress monitoring disabled"), interrupt=True
@@ -57,17 +57,17 @@ class command:
) )
def start_progress_monitoring(self): 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"]["lastProgressTime"] = time.time()
self.env["commandBuffer"]["lastProgressValue"] = -1 self.env["commandBuffer"]["lastProgressValue"] = -1
# Don't control speech - let user decide with silence_until_prompt # Don't control speech - let user decide with silence_until_prompt
def stop_progress_monitoring(self): 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 # Don't control speech - progress monitor is beep-only
def detect_progress(self, text): def detect_progress(self, text):
if not self.env["commandBuffer"]["progressMonitoring"]: if not self.env["commandBuffer"]["progress_monitoring"]:
return return
# Skip progress detection if current screen looks like a prompt # Skip progress detection if current screen looks like a prompt
@@ -36,11 +36,11 @@ class command:
def update_spell_language(self): def update_spell_language(self):
self.spellChecker = enchant.Dict( self.spellChecker = enchant.Dict(
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
) )
self.language = self.env["runtime"]["SettingsManager"].get_setting( self.language = self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
def run(self): def run(self):
@@ -51,7 +51,7 @@ class command:
return return
if ( if (
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
!= self.language != self.language
): ):
@@ -22,8 +22,8 @@ class command:
return _("Interrupts the current presentation") return _("Interrupts the current presentation")
def run(self): def run(self):
if len(self.env["input"]["prevDeepestInput"]) > len( if len(self.env["input"]["prev_deepest_input"]) > len(
self.env["input"]["currInput"] self.env["input"]["curr_input"]
): ):
return return
self.env["runtime"]["OutputManager"].interrupt_output() self.env["runtime"]["OutputManager"].interrupt_output()
@@ -36,11 +36,11 @@ class command:
return return
self.spellChecker = enchant.Dict( self.spellChecker = enchant.Dict(
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
) )
self.language = self.env["runtime"]["SettingsManager"].get_setting( self.language = self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
def run(self): def run(self):
@@ -51,7 +51,7 @@ class command:
return return
if ( if (
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
!= self.language != self.language
): ):
@@ -25,15 +25,15 @@ class command:
def run(self): def run(self):
self.env["runtime"]["SettingsManager"].set_setting( self.env["runtime"]["SettingsManager"].set_setting(
"general", "general",
"autoPresentIndent", "auto_present_indent",
str( str(
not self.env["runtime"]["SettingsManager"].get_setting_as_bool( not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoPresentIndent" "general", "auto_present_indent"
) )
), ),
) )
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoPresentIndent" "general", "auto_present_indent"
): ):
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("autoindent enabled"), sound_icon="", interrupt=True _("autoindent enabled"), sound_icon="", interrupt=True
@@ -25,15 +25,15 @@ class command:
def run(self): def run(self):
self.env["runtime"]["SettingsManager"].set_setting( self.env["runtime"]["SettingsManager"].set_setting(
"speech", "speech",
"autoReadIncoming", "auto_read_incoming",
str( str(
not self.env["runtime"]["SettingsManager"].get_setting_as_bool( not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"speech", "autoReadIncoming" "speech", "auto_read_incoming"
) )
), ),
) )
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"speech", "autoReadIncoming" "speech", "auto_read_incoming"
): ):
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("autoread enabled"), sound_icon="", interrupt=True _("autoread enabled"), sound_icon="", interrupt=True
@@ -24,15 +24,15 @@ class command:
def run(self): def run(self):
self.env["runtime"]["SettingsManager"].set_setting( self.env["runtime"]["SettingsManager"].set_setting(
"general", "general",
"autoSpellCheck", "auto_spell_check",
str( str(
not self.env["runtime"]["SettingsManager"].get_setting_as_bool( not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoSpellCheck" "general", "auto_spell_check"
) )
), ),
) )
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoSpellCheck" "general", "auto_spell_check"
): ):
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("auto spellcheck enabled"), sound_icon="", interrupt=True _("auto spellcheck enabled"), sound_icon="", interrupt=True
@@ -25,7 +25,7 @@ class command:
if self.env["runtime"]["PunctuationManager"].cycle_punctuation(): if self.env["runtime"]["PunctuationManager"].cycle_punctuation():
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "punctuationLevel" "general", "punctuation_level"
), ),
interrupt=True, interrupt=True,
ignore_punctuation=True, ignore_punctuation=True,
@@ -23,31 +23,31 @@ class command:
def run(self): def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "interruptOnKeyPress" "keyboard", "interrupt_on_key_press"
): ):
return return
if self.env["runtime"]["InputManager"].no_key_pressed(): if self.env["runtime"]["InputManager"].no_key_pressed():
return return
if self.env["runtime"]["ScreenManager"].is_screen_change(): if self.env["runtime"]["ScreenManager"].is_screen_change():
return return
if len(self.env["input"]["currInput"]) <= len( if len(self.env["input"]["curr_input"]) <= len(
self.env["input"]["prevInput"] self.env["input"]["prev_input"]
): ):
return return
# if the filter is set # if the filter is set
if ( if (
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("keyboard", "interruptOnKeyPressFilter") .get_setting("keyboard", "interrupt_on_key_press_filter")
.strip() .strip()
!= "" != ""
): ):
filter_list = ( filter_list = (
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("keyboard", "interruptOnKeyPressFilter") .get_setting("keyboard", "interrupt_on_key_press_filter")
.split(",") .split(",")
) )
for currInput in self.env["input"]["currInput"]: for curr_key in self.env["input"]["curr_input"]:
if currInput not in filter_list: if curr_key not in filter_list:
return return
self.env["runtime"]["OutputManager"].interrupt_output() self.env["runtime"]["OutputManager"].interrupt_output()
@@ -24,14 +24,14 @@ class command:
def run(self): def run(self):
# enabled? # enabled?
active = self.env["runtime"]["SettingsManager"].get_setting_as_int( active = self.env["runtime"]["SettingsManager"].get_setting_as_int(
"keyboard", "charEchoMode" "keyboard", "char_echo_mode"
) )
# 0 = off # 0 = off
if active == 0: if active == 0:
return return
# 2 = caps only # 2 = caps only
if active == 2: if active == 2:
if not self.env["input"]["newCapsLock"]: if not self.env["input"]["new_caps_lock"]:
return return
# big changes are no char (but the value is bigger than one maybe the # big changes are no char (but the value is bigger than one maybe the
# differ needs longer than you can type, so a little strange random # differ needs longer than you can type, so a little strange random
@@ -26,7 +26,7 @@ class command:
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "wordEcho" "keyboard", "word_echo"
): ):
return return
# is navigation? # is navigation?
@@ -39,23 +39,23 @@ class command:
return return
self.spellChecker = enchant.Dict( self.spellChecker = enchant.Dict(
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
) )
self.language = self.env["runtime"]["SettingsManager"].get_setting( self.language = self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
def run(self): def run(self):
if not initialized: if not initialized:
return return
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoSpellCheck" "general", "auto_spell_check"
): ):
return return
if ( if (
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "spellCheckLanguage" "general", "spell_check_language"
) )
!= self.language != self.language
): ):
@@ -23,7 +23,7 @@ class command:
def run(self): def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "charDeleteEcho" "keyboard", "char_delete_echo"
): ):
return return
# detect typing or chilling # detect typing or chilling
@@ -46,7 +46,7 @@ class command:
# echo word insteed of char # echo word insteed of char
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "wordEcho" "keyboard", "word_echo"
): ):
if ( if (
abs( abs(
@@ -55,17 +55,17 @@ class command:
self.lastIdent = curr_ident self.lastIdent = curr_ident
do_interrupt = True do_interrupt = True
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoPresentIndent" "general", "auto_present_indent"
): ):
if self.env["runtime"]["SettingsManager"].get_setting_as_int( if self.env["runtime"]["SettingsManager"].get_setting_as_int(
"general", "autoPresentIndentMode" "general", "auto_present_indent_mode"
) in [0, 1]: ) in [0, 1]:
if self.lastIdent != curr_ident: if self.lastIdent != curr_ident:
self.env["runtime"]["OutputManager"].play_frequence( self.env["runtime"]["OutputManager"].play_frequence(
curr_ident * 50, 0.1, interrupt=do_interrupt curr_ident * 50, 0.1, interrupt=do_interrupt
) )
if self.env["runtime"]["SettingsManager"].get_setting_as_int( if self.env["runtime"]["SettingsManager"].get_setting_as_int(
"general", "autoPresentIndentMode" "general", "auto_present_indent_mode"
) in [0, 2]: ) in [0, 2]:
if self.lastIdent != curr_ident: if self.lastIdent != curr_ident:
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
@@ -68,10 +68,10 @@ class command:
# Only beep/announce if indentation level has changed # Only beep/announce if indentation level has changed
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "autoPresentIndent" "general", "auto_present_indent"
) and self.lastIdent != curr_ident: ) and self.lastIdent != curr_ident:
if self.env["runtime"]["SettingsManager"].get_setting_as_int( if self.env["runtime"]["SettingsManager"].get_setting_as_int(
"general", "autoPresentIndentMode" "general", "auto_present_indent_mode"
) in [0, 1]: ) in [0, 1]:
self.env["runtime"]["OutputManager"].play_frequence( self.env["runtime"]["OutputManager"].play_frequence(
curr_ident * 50, 0.1, interrupt=False curr_ident * 50, 0.1, interrupt=False
@@ -23,7 +23,7 @@ class command:
def run(self): def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"review", "leaveReviewOnCursorChange" "review", "leave_review_on_cursor_change"
): ):
return return
if self.env["runtime"]["CursorManager"].is_review_mode(): if self.env["runtime"]["CursorManager"].is_review_mode():
@@ -22,31 +22,31 @@ class command:
def run(self): def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "interruptOnKeyPress" "keyboard", "interrupt_on_key_press"
): ):
return return
if self.env["runtime"]["InputManager"].no_key_pressed(): if self.env["runtime"]["InputManager"].no_key_pressed():
return return
if self.env["runtime"]["ScreenManager"].is_screen_change(): if self.env["runtime"]["ScreenManager"].is_screen_change():
return return
if len(self.env["input"]["currInput"]) <= len( if len(self.env["input"]["curr_input"]) <= len(
self.env["input"]["prevInput"] self.env["input"]["prev_input"]
): ):
return return
# if the filter is set # if the filter is set
if ( if (
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("keyboard", "interruptOnKeyPressFilter") .get_setting("keyboard", "interrupt_on_key_press_filter")
.strip() .strip()
!= "" != ""
): ):
filter_list = ( filter_list = (
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("keyboard", "interruptOnKeyPressFilter") .get_setting("keyboard", "interrupt_on_key_press_filter")
.split(",") .split(",")
) )
for currInput in self.env["input"]["currInput"]: for curr_key in self.env["input"]["curr_input"]:
if currInput not in filter_list: if curr_key not in filter_list:
return return
self.env["runtime"]["OutputManager"].interrupt_output() self.env["runtime"]["OutputManager"].interrupt_output()
@@ -24,7 +24,7 @@ class command:
def run(self): def run(self):
if self.env["runtime"]["InputManager"].no_key_pressed(): if self.env["runtime"]["InputManager"].no_key_pressed():
return return
if len(self.env["input"]["prevInput"]) > 0: if len(self.env["input"]["prev_input"]) > 0:
return return
if not self.env["commandBuffer"]["enableSpeechOnKeypress"]: if not self.env["commandBuffer"]["enableSpeechOnKeypress"]:
return return
@@ -23,11 +23,11 @@ class command:
def run(self): def run(self):
if ( if (
self.env["input"]["oldCapsLock"] self.env["input"]["old_caps_lock"]
== self.env["input"]["newCapsLock"] == self.env["input"]["new_caps_lock"]
): ):
return return
if self.env["input"]["newCapsLock"]: if self.env["input"]["new_caps_lock"]:
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("Capslock on"), interrupt=True _("Capslock on"), interrupt=True
) )
@@ -23,11 +23,11 @@ class command:
def run(self): def run(self):
if ( if (
self.env["input"]["oldScrollLock"] self.env["input"]["old_scroll_lock"]
== self.env["input"]["newScrollLock"] == self.env["input"]["new_scroll_lock"]
): ):
return return
if self.env["input"]["newScrollLock"]: if self.env["input"]["new_scroll_lock"]:
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("Scrolllock on"), interrupt=True _("Scrolllock on"), interrupt=True
) )
@@ -22,12 +22,12 @@ class command:
return "No description found" return "No description found"
def run(self): def run(self):
if self.env["input"]["oldNumLock"] == self.env["input"]["newNumLock"]: if self.env["input"]["old_num_lock"] == self.env["input"]["new_num_lock"]:
return return
# Only announce numlock changes if an actual numlock key was pressed # Only announce numlock changes if an actual numlock key was pressed
# AND the LED state actually changed (some numpads send spurious NUMLOCK events) # AND the LED state actually changed (some numpads send spurious NUMLOCK events)
current_input = self.env["input"]["currInput"] current_input = self.env["input"]["curr_input"]
# Check if this is a genuine numlock key press by verifying: # Check if this is a genuine numlock key press by verifying:
# 1. KEY_NUMLOCK is in the current input sequence # 1. KEY_NUMLOCK is in the current input sequence
@@ -40,7 +40,7 @@ class command:
) )
if is_genuine_numlock: if is_genuine_numlock:
if self.env["input"]["newNumLock"]: if self.env["input"]["new_num_lock"]:
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
_("Numlock on"), interrupt=True _("Numlock on"), interrupt=True
) )
@@ -23,7 +23,7 @@ class command:
def run(self): def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"review", "leaveReviewOnScreenChange" "review", "leave_review_on_screen_change"
): ):
return return
self.env["runtime"]["CursorManager"].clear_review_cursor() self.env["runtime"]["CursorManager"].clear_review_cursor()
@@ -25,8 +25,8 @@ class command:
# Only run if progress monitoring is enabled # Only run if progress monitoring is enabled
try: try:
if ( if (
"progressMonitoring" in self.env["commandBuffer"] "progress_monitoring" in self.env["commandBuffer"]
and self.env["commandBuffer"]["progressMonitoring"] and self.env["commandBuffer"]["progress_monitoring"]
): ):
# Check if current line is a prompt - if so, reset progress # Check if current line is a prompt - if so, reset progress
# state # state
@@ -40,13 +40,19 @@ class command:
): ):
self.detect_progress(self.env["screen"]["new_delta"]) self.detect_progress(self.env["screen"]["new_delta"])
except Exception as e: except Exception as e:
# Silently ignore errors to avoid disrupting normal operation # Log errors for debugging instead of silently ignoring
pass self.env["runtime"]["DebugManager"].write_debug_out(
"Progress detector error: " + str(e),
debug.DebugLevel.ERROR,
)
def is_real_progress_update(self): def is_real_progress_update(self):
"""Check if this is a real progress update vs screen change/window switch""" """Check if this is a real progress update vs screen change/window switch"""
# If the screen/application changed, it's not a progress update # If the screen/application changed, it's not a progress update
if self.env["runtime"]["ScreenManager"].is_screen_change(): if self.env["runtime"]["ScreenManager"].is_screen_change():
self.env["runtime"]["DebugManager"].write_debug_out(
"Progress filter: screen change detected", debug.DebugLevel.INFO
)
return False return False
# If there was a large cursor movement, it's likely navigation, not # If there was a large cursor movement, it's likely navigation, not
@@ -62,6 +68,10 @@ class command:
) )
# Large movements suggest navigation, not progress output # Large movements suggest navigation, not progress output
if y_move > 2 or x_move > 20: if y_move > 2 or x_move > 20:
self.env["runtime"]["DebugManager"].write_debug_out(
f"Progress filter: large cursor move y={y_move} x={x_move}",
debug.DebugLevel.INFO,
)
return False return False
# Check if delta is too large (screen change) vs small incremental # Check if delta is too large (screen change) vs small incremental
@@ -71,16 +81,27 @@ class command:
if ( if (
delta_length > 200 delta_length > 200
): # Allow longer progress lines like Claude Code's status ): # Allow longer progress lines like Claude Code's status
self.env["runtime"]["DebugManager"].write_debug_out(
f"Progress filter: delta too long ({delta_length})",
debug.DebugLevel.INFO,
)
return False return False
# If delta contains newlines and is substantial, let incoming handler # If delta contains newlines and is substantial, let incoming handler
# deal with it to avoid interfering with multi-line text output # deal with it to avoid interfering with multi-line text output
if '\n' in delta_text and delta_length > 50: if '\n' in delta_text and delta_length > 50:
self.env["runtime"]["DebugManager"].write_debug_out(
f"Progress filter: multiline delta ({delta_length} chars)",
debug.DebugLevel.INFO,
)
return False return False
# Check if current line looks like a prompt - progress unlikely during # Check if current line looks like a prompt - progress unlikely during
# prompts # prompts
if self.is_current_line_prompt(): if self.is_current_line_prompt():
self.env["runtime"]["DebugManager"].write_debug_out(
"Progress filter: prompt detected", debug.DebugLevel.INFO
)
return False return False
return True return True
@@ -284,10 +305,61 @@ class command:
self.env["commandBuffer"]["lastProgressTime"] = current_time self.env["commandBuffer"]["lastProgressTime"] = current_time
return return
# Pattern 6: Claude Code progress indicators # Pattern 6: Claude Code working indicators (various symbols + activity text + "esc to interrupt")
claude_progress_match = re.search(r'[·✶✢✻✽*].*?\(esc to interrupt[^)]*\)', text) # Matches any: [symbol] [Task description]… (... esc to interrupt ...)
# Symbols include: * ✢ ✽ ✶ ✻ · • ◦ ○ ● ◆ and similar decorative characters
# Example: ✽ Reviewing script for issues… (esc to interrupt · ctrl+t to show todos · 1m 25s · ↑ 887 tokens)
claude_progress_match = re.search(
r'[*✢✽✶✻·•◦○●◆]\s+\w+.*?…\s*\(.*esc to interrupt.*\)',
text,
re.IGNORECASE,
)
if claude_progress_match: if claude_progress_match:
if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.0: if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.0:
self.env["runtime"]["DebugManager"].write_debug_out(
"Playing Claude Code activity beep",
debug.DebugLevel.INFO,
)
self.play_activity_beep()
self.env["commandBuffer"]["lastProgressTime"] = current_time
return
# Pattern 6b: Claude Code tool invocation indicators (● Tool Name(...))
# Example: ● Web Search("query here")
tool_invocation_match = re.search(
r'[●○◉•◦]\s+(?:Web\s*Search|Read|Write|Edit|Bash|Glob|Grep|Task|WebFetch)\s*\(',
text,
re.IGNORECASE,
)
if tool_invocation_match:
if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.0:
self.env["runtime"]["DebugManager"].write_debug_out(
"Playing Claude Code tool invocation beep",
debug.DebugLevel.INFO,
)
self.play_activity_beep()
self.env["commandBuffer"]["lastProgressTime"] = current_time
return
# Pattern 6c: Bullet/white bullet activity lines (•/◦ ...)
bullet_activity_match = re.search(
(
r'^\s*[•◦]\s+.*(?:…|\.{3,}|\b(?:thinking|working|processing|'
r'analyzing|searching|reading|writing|planning|running|'
r'executing|updating|building|installing|compiling|downloading|'
r'reviewing|generating|responding|applying|fixing|editing|'
r'creating|preparing|checking|opening|loading|fetching|'
r'retrieving|scanning|indexing|summarizing)\b)'
),
text,
re.IGNORECASE,
)
if bullet_activity_match:
if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.0:
self.env["runtime"]["DebugManager"].write_debug_out(
"Playing bullet activity beep",
debug.DebugLevel.INFO,
)
self.play_activity_beep() self.play_activity_beep()
self.env["commandBuffer"]["lastProgressTime"] = current_time self.env["commandBuffer"]["lastProgressTime"] = current_time
return return
@@ -327,6 +399,23 @@ class command:
self.env["commandBuffer"]["lastProgressTime"] = current_time self.env["commandBuffer"]["lastProgressTime"] = current_time
return return
# Pattern 10: Task status indicators (● Task Output, ○ Task Running, etc.)
# Matches bullet points with task-related status text
task_status_match = re.search(
r'[●○◉]\s+(?:Task\s+)?(?:Output|Running|Pending|Working|Processing)\s+[a-zA-Z0-9]+',
text,
re.IGNORECASE,
)
if task_status_match:
if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.5:
self.env["runtime"]["DebugManager"].write_debug_out(
"Playing task status activity beep",
debug.DebugLevel.INFO,
)
self.play_activity_beep()
self.env["commandBuffer"]["lastProgressTime"] = current_time
return
def play_progress_tone(self, percentage): def play_progress_tone(self, percentage):
# Map 0-100% to 400-1200Hz frequency range # Map 0-100% to 400-1200Hz frequency range
frequency = 400 + (percentage * 8) frequency = 400 + (percentage * 8)
@@ -42,7 +42,7 @@ class command:
def run(self): def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"speech", "autoReadIncoming" "speech", "auto_read_incoming"
): ):
return return
# is there something to read? # is there something to read?
@@ -1,66 +0,0 @@
#!/usr/bin/env python3
import time
from fenrirscreenreader.core.i18n import _
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributors.
class command:
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def get_description(self):
return "No Description found"
def run(self):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"promote", "enabled"
):
return
if (
self.env["runtime"]["SettingsManager"]
.get_setting("promote", "list")
.strip(" \t\n")
== ""
):
return
if int(time.time() - self.env["input"]["lastInputTime"]) < self.env[
"runtime"
]["SettingsManager"].get_setting_as_int(
"promote", "inactiveTimeoutSec"
):
return
if (
len(
self.env["runtime"]["SettingsManager"].get_setting(
"promote", "list"
)
)
== 0
):
return
for promote in (
self.env["runtime"]["SettingsManager"]
.get_setting("promote", "list")
.split(",")
):
if promote in self.env["screen"]["new_delta"]:
self.env["runtime"]["OutputManager"].play_sound_icon(
"PromotedText"
)
self.env["input"]["lastInputTime"] = time.time()
return
def set_callback(self, callback):
pass
@@ -134,7 +134,7 @@ class config_command:
self.config.add_section("keyboard") self.config.add_section("keyboard")
self.config.set("keyboard", "driver", "evdevDriver") 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.add_section("screen")
self.config.set("screen", "driver", "vcsaDriver") self.config.set("screen", "driver", "vcsaDriver")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set punctuation to All (every punctuation mark)" return "Set punctuation to All (every punctuation mark)"
def run(self): 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": if current_level.lower() == "all":
self.present_text("Punctuation level already set to All") self.present_text("Punctuation level already set to All")
return return
success = self.set_setting("general", "punctuationLevel", "all") success = self.set_setting("general", "punctuation_level", "all")
if success: if success:
self.present_text("Punctuation level set to All - every punctuation mark will be spoken") self.present_text("Punctuation level set to All - every punctuation mark will be spoken")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set punctuation to Most (detailed punctuation)" return "Set punctuation to Most (detailed punctuation)"
def run(self): 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": if current_level.lower() == "most":
self.present_text("Punctuation level already set to Most") self.present_text("Punctuation level already set to Most")
return return
success = self.set_setting("general", "punctuationLevel", "most") success = self.set_setting("general", "punctuation_level", "most")
if success: if success:
self.present_text("Punctuation level set to Most - detailed punctuation will be spoken") self.present_text("Punctuation level set to Most - detailed punctuation will be spoken")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set punctuation to None (no punctuation spoken)" return "Set punctuation to None (no punctuation spoken)"
def run(self): 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": if current_level.lower() == "none":
self.present_text("Punctuation level already set to None") self.present_text("Punctuation level already set to None")
return return
success = self.set_setting("general", "punctuationLevel", "none") success = self.set_setting("general", "punctuation_level", "none")
if success: if success:
self.present_text("Punctuation level set to None - no punctuation will be spoken") self.present_text("Punctuation level set to None - no punctuation will be spoken")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set punctuation to Some (basic punctuation only)" return "Set punctuation to Some (basic punctuation only)"
def run(self): 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": if current_level.lower() == "some":
self.present_text("Punctuation level already set to Some") self.present_text("Punctuation level already set to Some")
return return
success = self.set_setting("general", "punctuationLevel", "some") success = self.set_setting("general", "punctuation_level", "some")
if success: if success:
self.present_text("Punctuation level set to Some - basic punctuation will be spoken") self.present_text("Punctuation level set to Some - basic punctuation will be spoken")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set character echo to Always (echo all typed characters)" return "Set character echo to Always (echo all typed characters)"
def run(self): 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": if current_mode == "1":
self.present_text("Character echo already set to Always") self.present_text("Character echo already set to Always")
return return
success = self.set_setting("keyboard", "charEchoMode", "1") success = self.set_setting("keyboard", "char_echo_mode", "1")
if success: if success:
self.present_text("Character echo set to Always - all typed characters will be spoken") self.present_text("Character echo set to Always - all typed characters will be spoken")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set character echo to Caps Lock (echo only when caps lock is on)" return "Set character echo to Caps Lock (echo only when caps lock is on)"
def run(self): 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": if current_mode == "2":
self.present_text("Character echo already set to Caps Lock mode") self.present_text("Character echo already set to Caps Lock mode")
return return
success = self.set_setting("keyboard", "charEchoMode", "2") success = self.set_setting("keyboard", "char_echo_mode", "2")
if success: if success:
self.present_text("Character echo set to Caps Lock mode - characters will be spoken only when caps lock is on") self.present_text("Character echo set to Caps Lock mode - characters will be spoken only when caps lock is on")
@@ -21,13 +21,13 @@ class command(config_command):
return "Set character echo to None (no character echo)" return "Set character echo to None (no character echo)"
def run(self): 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": if current_mode == "0":
self.present_text("Character echo already set to None") self.present_text("Character echo already set to None")
return return
success = self.set_setting("keyboard", "charEchoMode", "0") success = self.set_setting("keyboard", "char_echo_mode", "0")
if success: if success:
self.present_text("Character echo set to None - no typed characters will be spoken") self.present_text("Character echo set to None - no typed characters will be spoken")
@@ -21,8 +21,8 @@ class command(config_command):
return "Toggle exclusive keyboard access" return "Toggle exclusive keyboard access"
def run(self): def run(self):
current_state = self.getBooleanSetting("keyboard", "grabDevices", True) current_state = self.getBooleanSetting("keyboard", "grab_devices", True)
new_state = self.toggleBooleanSetting("keyboard", "grabDevices") new_state = self.toggleBooleanSetting("keyboard", "grab_devices")
if new_state != current_state: if new_state != current_state:
state_text = "enabled" if new_state else "disabled" state_text = "enabled" if new_state else "disabled"
@@ -21,8 +21,8 @@ class command(config_command):
return "Toggle word echo when pressing space" return "Toggle word echo when pressing space"
def run(self): def run(self):
current_state = self.getBooleanSetting("keyboard", "wordEcho", False) current_state = self.getBooleanSetting("keyboard", "word_echo", False)
new_state = self.toggleBooleanSetting("keyboard", "wordEcho") new_state = self.toggleBooleanSetting("keyboard", "word_echo")
if new_state != current_state: if new_state != current_state:
state_text = "enabled" if new_state else "disabled" state_text = "enabled" if new_state else "disabled"
@@ -108,7 +108,7 @@ class command(config_command):
"rate": "0.5", "rate": "0.5",
"pitch": "0.5", "pitch": "0.5",
"volume": "1.0", "volume": "1.0",
"autoReadIncoming": "True", "auto_read_incoming": "True",
} }
# Basic sound defaults # Basic sound defaults
@@ -123,10 +123,10 @@ class command(config_command):
self.config["keyboard"] = { self.config["keyboard"] = {
"driver": "evdevDriver", "driver": "evdevDriver",
"device": "ALL", "device": "ALL",
"keyboardLayout": "desktop", "keyboard_layout": "desktop",
"charEchoMode": "1", "char_echo_mode": "1",
"wordEcho": "False", "word_echo": "False",
"charDeleteEcho": "True", "char_delete_echo": "True",
} }
# Basic screen defaults # Basic screen defaults
@@ -137,9 +137,9 @@ class command(config_command):
# Basic general defaults # Basic general defaults
self.config["general"] = { self.config["general"] = {
"punctuationLevel": "some", "punctuation_level": "some",
"debug_level": "0", "debug_level": "0",
"numberOfClipboards": "50", "number_of_clipboards": "50",
} }
# Write the configuration # Write the configuration
+1 -1
View File
@@ -112,7 +112,7 @@ class ByteManager:
if self.lastByteKey == converted_escape_sequence: if self.lastByteKey == converted_escape_sequence:
if time.time() - self.lastInputTime <= self.env["runtime"][ if time.time() - self.lastInputTime <= self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_float("keyboard", "doubleTapTimeout"): ].get_setting_as_float("keyboard", "double_tap_timeout"):
self.repeat += 1 self.repeat += 1
shortcut_data = b"" shortcut_data = b""
for i in range(self.repeat): for i in range(self.repeat):
+1 -1
View File
@@ -21,7 +21,7 @@ class CursorManager:
Return False if numlock is ON (let keys type numbers) Return False if numlock is ON (let keys type numbers)
""" """
# Return False if numlock is ON # Return False if numlock is ON
return not self.env["input"]["newNumLock"] return not self.env["input"]["new_num_lock"]
def shutdown(self): def shutdown(self):
pass pass
@@ -29,7 +29,7 @@ class DynamicKeyboardLayoutCommand:
try: try:
settingsManager = self.env["runtime"]["SettingsManager"] settingsManager = self.env["runtime"]["SettingsManager"]
currentLayout = settingsManager.get_setting( currentLayout = settingsManager.get_setting(
"keyboard", "keyboardLayout" "keyboard", "keyboard_layout"
) )
# Check if already set (compare both full path and base name) # Check if already set (compare both full path and base name)
@@ -44,7 +44,7 @@ class DynamicKeyboardLayoutCommand:
try: try:
# Update the setting in memory # Update the setting in memory
settingsManager.set_setting( settingsManager.set_setting(
"keyboard", "keyboardLayout", self.layoutPath "keyboard", "keyboard_layout", self.layoutPath
) )
# Save to the actual config file # Save to the actual config file
@@ -162,7 +162,7 @@ def get_keyboard_layouts(env):
# Get current layout setting path # Get current layout setting path
try: try:
currentLayoutSetting = env["runtime"]["SettingsManager"].get_setting( currentLayoutSetting = env["runtime"]["SettingsManager"].get_setting(
"keyboard", "keyboardLayout" "keyboard", "keyboard_layout"
) )
if currentLayoutSetting and os.path.exists(currentLayoutSetting): if currentLayoutSetting and os.path.exists(currentLayoutSetting):
currentLayoutDir = os.path.dirname(currentLayoutSetting) currentLayoutDir = os.path.dirname(currentLayoutSetting)
+2 -21
View File
@@ -17,8 +17,7 @@ from fenrirscreenreader.core.eventData import FenrirEventType
class EventManager: class EventManager:
def __init__(self): def __init__(self):
self.running = Value(c_bool, True) self.running = Value(c_bool, True)
# Bounded queue to prevent memory exhaustion self._eventQueue = Queue()
self._eventQueue = Queue(maxsize=100)
self.clean_event_queue() self.clean_event_queue()
def initialize(self, environment): def initialize(self, environment):
@@ -107,23 +106,5 @@ class EventManager:
return False return False
if event == FenrirEventType.ignore: if event == FenrirEventType.ignore:
return False return False
# Use bounded queue - if full, this will block briefly or drop older self._eventQueue.put({"Type": event, "data": data})
# events
try:
self._eventQueue.put({"Type": event, "data": data}, timeout=0.1)
except Exception as e:
# Queue full - drop oldest event and add new one for critical
# events
if event in [
FenrirEventType.screen_update,
FenrirEventType.keyboard_input,
]:
try:
self._eventQueue.get_nowait() # Remove oldest
self._eventQueue.put(
{"Type": event, "data": data}, timeout=0.1
)
except BaseException:
pass # If still can't add, drop the event
# For non-critical events, just drop them if queue is full
return True return True
+8 -8
View File
@@ -69,9 +69,9 @@ class FenrirManager:
].get_input_event() ].get_input_event()
if event["data"]: if event["data"]:
event["data"]["EventName"] = self.environment["runtime"][ event["data"]["event_name"] = self.environment["runtime"][
"InputManager" "InputManager"
].convert_event_name(event["data"]["EventName"]) ].convert_event_name(event["data"]["event_name"])
self.environment["runtime"]["InputManager"].handle_input_event( self.environment["runtime"]["InputManager"].handle_input_event(
event["data"] event["data"]
) )
@@ -121,8 +121,8 @@ class FenrirManager:
self.environment["runtime"]["InputManager"].write_event_buffer() self.environment["runtime"]["InputManager"].write_event_buffer()
self.environment["runtime"]["InputManager"].handle_device_grab() self.environment["runtime"]["InputManager"].handle_device_grab()
if self.environment["input"]["keyForeward"] > 0: if self.environment["input"]["key_forward"] > 0:
self.environment["input"]["keyForeward"] -= 1 self.environment["input"]["key_forward"] -= 1
self.environment["runtime"]["CommandManager"].execute_default_trigger( self.environment["runtime"]["CommandManager"].execute_default_trigger(
"onKeyInput" "onKeyInput"
@@ -265,11 +265,11 @@ class FenrirManager:
) )
def detect_shortcut_command(self): def detect_shortcut_command(self):
if self.environment["input"]["keyForeward"] > 0: if self.environment["input"]["key_forward"] > 0:
return return
if len(self.environment["input"]["prevInput"]) > len( if len(self.environment["input"]["prev_input"]) > len(
self.environment["input"]["currInput"] self.environment["input"]["curr_input"]
): ):
return return
@@ -283,7 +283,7 @@ class FenrirManager:
].no_key_pressed(): ].no_key_pressed():
if self.singleKeyCommand: if self.singleKeyCommand:
self.singleKeyCommand = ( self.singleKeyCommand = (
len(self.environment["input"]["currInput"]) == 1 len(self.environment["input"]["curr_input"]) == 1
) )
if not ( if not (
+20 -18
View File
@@ -9,28 +9,30 @@ import time
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
input_data = { input_data = {
"currInput": [], "curr_input": [],
"prevDeepestInput": [], "prev_input": [],
"eventBuffer": [], "prev_deepest_input": [],
"event_buffer": [],
"shortcut_repeat": 0, "shortcut_repeat": 0,
"fenrirKey": [], "fenrir_key": [],
"scriptKey": [], "script_key": [],
"keyForeward": 0, "key_forward": 0,
"lastInputTime": time.time(), "last_input_time": time.time(),
"oldNumLock": True, "old_num_lock": True,
"newNumLock": True, "new_num_lock": True,
"oldScrollLock": True, "old_scroll_lock": True,
"newScrollLock": True, "new_scroll_lock": True,
"oldCapsLock": False, "old_caps_lock": False,
"newCapsLock": False, "new_caps_lock": False,
} }
input_event = { input_event = {
"EventName": "", "event_name": "",
"EventValue": "", "event_value": "",
"EventSec": 0, "event_sec": 0,
"EventUsec": 0, "event_usec": 0,
"EventState": 0, "event_state": 0,
"event_type": 0,
} }
key_names = [ key_names = [
+1 -1
View File
@@ -30,7 +30,7 @@ class InputDriver:
def clear_event_buffer(self): def clear_event_buffer(self):
if not self._initialized: if not self._initialized:
return return
del self.env["input"]["eventBuffer"][:] del self.env["input"]["event_buffer"][:]
def update_input_devices(self, new_devices=None, init=False): def update_input_devices(self, new_devices=None, init=False):
if not self._initialized: if not self._initialized:
+60 -60
View File
@@ -43,18 +43,18 @@ class InputManager:
self.update_input_devices() self.update_input_devices()
# init LEDs with current state # init LEDs with current state
self.env["input"]["newNumLock"] = self.env["runtime"][ self.env["input"]["new_num_lock"] = self.env["runtime"][
"InputDriver" "InputDriver"
].get_led_state() ].get_led_state()
self.env["input"]["oldNumLock"] = self.env["input"]["newNumLock"] self.env["input"]["old_num_lock"] = self.env["input"]["new_num_lock"]
self.env["input"]["newCapsLock"] = self.env["runtime"][ self.env["input"]["new_caps_lock"] = self.env["runtime"][
"InputDriver" "InputDriver"
].get_led_state(1) ].get_led_state(1)
self.env["input"]["oldCapsLock"] = self.env["input"]["newCapsLock"] self.env["input"]["old_caps_lock"] = self.env["input"]["new_caps_lock"]
self.env["input"]["newScrollLock"] = self.env["runtime"][ self.env["input"]["new_scroll_lock"] = self.env["runtime"][
"InputDriver" "InputDriver"
].get_led_state(2) ].get_led_state(2)
self.env["input"]["oldScrollLock"] = self.env["input"]["newScrollLock"] self.env["input"]["old_scroll_lock"] = self.env["input"]["new_scroll_lock"]
self.lastDeepestInput = [] self.lastDeepestInput = []
self.lastEvent = None self.lastEvent = None
self.env["input"]["shortcut_repeat"] = 1 self.env["input"]["shortcut_repeat"] = 1
@@ -84,12 +84,12 @@ class InputManager:
self.set_execute_device_grab() self.set_execute_device_grab()
if not self.executeDeviceGrab: if not self.executeDeviceGrab:
return return
if self.env["input"]["eventBuffer"] != []: if self.env["input"]["event_buffer"] != []:
return return
if not self.no_key_pressed(): if not self.no_key_pressed():
return return
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
self.executeDeviceGrab = False self.executeDeviceGrab = False
return return
@@ -176,75 +176,75 @@ class InputManager:
return return
self.lastEvent = event_data self.lastEvent = event_data
# a hang apears.. try to fix # a hang apears.. try to fix
if self.env["input"]["eventBuffer"] == []: if self.env["input"]["event_buffer"] == []:
if self.env["input"]["currInput"] != []: if self.env["input"]["curr_input"] != []:
self.env["input"]["currInput"] = [] self.env["input"]["curr_input"] = []
self.env["input"]["shortcut_repeat"] = 1 self.env["input"]["shortcut_repeat"] = 1
self.env["input"]["prevInput"] = self.env["input"]["currInput"].copy() self.env["input"]["prev_input"] = self.env["input"]["curr_input"].copy()
if event_data["EventState"] == 0: if event_data["event_state"] == 0:
if event_data["EventName"] in self.env["input"]["currInput"]: if event_data["event_name"] in self.env["input"]["curr_input"]:
self.env["input"]["currInput"].remove(event_data["EventName"]) self.env["input"]["curr_input"].remove(event_data["event_name"])
if len(self.env["input"]["currInput"]) > 1: if len(self.env["input"]["curr_input"]) > 1:
self.env["input"]["currInput"] = sorted( self.env["input"]["curr_input"] = sorted(
self.env["input"]["currInput"] self.env["input"]["curr_input"]
) )
elif len(self.env["input"]["currInput"]) == 0: elif len(self.env["input"]["curr_input"]) == 0:
self.env["input"]["shortcut_repeat"] = 1 self.env["input"]["shortcut_repeat"] = 1
self.lastInputTime = time.time() self.lastInputTime = time.time()
elif event_data["EventState"] == 1: elif event_data["event_state"] == 1:
if not event_data["EventName"] in self.env["input"]["currInput"]: if not event_data["event_name"] in self.env["input"]["curr_input"]:
self.env["input"]["currInput"].append(event_data["EventName"]) self.env["input"]["curr_input"].append(event_data["event_name"])
if len(self.env["input"]["currInput"]) > 1: if len(self.env["input"]["curr_input"]) > 1:
self.env["input"]["currInput"] = sorted( self.env["input"]["curr_input"] = sorted(
self.env["input"]["currInput"] self.env["input"]["curr_input"]
) )
if len(self.lastDeepestInput) < len( if len(self.lastDeepestInput) < len(
self.env["input"]["currInput"] self.env["input"]["curr_input"]
): ):
self.set_last_deepest_input( self.set_last_deepest_input(
self.env["input"]["currInput"].copy() self.env["input"]["curr_input"].copy()
) )
elif self.lastDeepestInput == self.env["input"]["currInput"]: elif self.lastDeepestInput == self.env["input"]["curr_input"]:
if time.time() - self.lastInputTime <= self.env["runtime"][ if time.time() - self.lastInputTime <= self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_float("keyboard", "doubleTapTimeout"): ].get_setting_as_float("keyboard", "double_tap_timeout"):
self.env["input"]["shortcut_repeat"] += 1 self.env["input"]["shortcut_repeat"] += 1
else: else:
self.env["input"]["shortcut_repeat"] = 1 self.env["input"]["shortcut_repeat"] = 1
self.handle_led_states(event_data) self.handle_led_states(event_data)
self.lastInputTime = time.time() self.lastInputTime = time.time()
elif event_data["EventState"] == 2: elif event_data["event_state"] == 2:
self.lastInputTime = time.time() self.lastInputTime = time.time()
self.env["input"]["oldNumLock"] = self.env["input"]["newNumLock"] self.env["input"]["old_num_lock"] = self.env["input"]["new_num_lock"]
self.env["input"]["newNumLock"] = self.env["runtime"][ self.env["input"]["new_num_lock"] = self.env["runtime"][
"InputDriver" "InputDriver"
].get_led_state() ].get_led_state()
self.env["input"]["oldCapsLock"] = self.env["input"]["newCapsLock"] self.env["input"]["old_caps_lock"] = self.env["input"]["new_caps_lock"]
self.env["input"]["newCapsLock"] = self.env["runtime"][ self.env["input"]["new_caps_lock"] = self.env["runtime"][
"InputDriver" "InputDriver"
].get_led_state(1) ].get_led_state(1)
self.env["input"]["oldScrollLock"] = self.env["input"]["newScrollLock"] self.env["input"]["old_scroll_lock"] = self.env["input"]["new_scroll_lock"]
self.env["input"]["newScrollLock"] = self.env["runtime"][ self.env["input"]["new_scroll_lock"] = self.env["runtime"][
"InputDriver" "InputDriver"
].get_led_state(2) ].get_led_state(2)
self.env["runtime"]["DebugManager"].write_debug_out( self.env["runtime"]["DebugManager"].write_debug_out(
"currInput " + str(self.env["input"]["currInput"]), "curr_input " + str(self.env["input"]["curr_input"]),
debug.DebugLevel.INFO, debug.DebugLevel.INFO,
) )
if self.no_key_pressed(): if self.no_key_pressed():
self.env["input"]["prevInput"] = [] self.env["input"]["prev_input"] = []
def handle_led_states(self, m_event): def handle_led_states(self, m_event):
if self.curr_key_is_modifier(): if self.curr_key_is_modifier():
return return
try: try:
if m_event["EventName"] == "KEY_NUMLOCK": if m_event["event_name"] == "KEY_NUMLOCK":
self.env["runtime"]["InputDriver"].toggle_led_state() self.env["runtime"]["InputDriver"].toggle_led_state()
elif m_event["EventName"] == "KEY_CAPSLOCK": elif m_event["event_name"] == "KEY_CAPSLOCK":
self.env["runtime"]["InputDriver"].toggle_led_state(1) self.env["runtime"]["InputDriver"].toggle_led_state(1)
elif m_event["EventName"] == "KEY_SCROLLLOCK": elif m_event["event_name"] == "KEY_SCROLLLOCK":
self.env["runtime"]["InputDriver"].toggle_led_state(2) self.env["runtime"]["InputDriver"].toggle_led_state(2)
except Exception as e: except Exception as e:
self.env["runtime"]["DebugManager"].write_debug_out( self.env["runtime"]["DebugManager"].write_debug_out(
@@ -255,7 +255,7 @@ class InputManager:
def grab_all_devices(self): def grab_all_devices(self):
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
try: try:
return self.env["runtime"]["InputDriver"].grab_all_devices() return self.env["runtime"]["InputDriver"].grab_all_devices()
@@ -265,7 +265,7 @@ class InputManager:
def ungrab_all_devices(self): def ungrab_all_devices(self):
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
try: try:
return self.env["runtime"]["InputDriver"].ungrab_all_devices() return self.env["runtime"]["InputDriver"].ungrab_all_devices()
@@ -355,7 +355,7 @@ class InputManager:
def write_event_buffer(self): def write_event_buffer(self):
try: try:
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
self.env["runtime"]["InputDriver"].write_event_buffer() self.env["runtime"]["InputDriver"].write_event_buffer()
self.clear_event_buffer() self.clear_event_buffer()
@@ -368,11 +368,11 @@ class InputManager:
) )
def no_key_pressed(self): def no_key_pressed(self):
return self.env["input"]["currInput"] == [] return self.env["input"]["curr_input"] == []
def is_key_press(self): def is_key_press(self):
return (self.env["input"]["prevInput"] == []) and ( return (self.env["input"]["prev_input"] == []) and (
self.env["input"]["currInput"] != [] self.env["input"]["curr_input"] != []
) )
def get_prev_deepest_shortcut(self): def get_prev_deepest_shortcut(self):
@@ -384,7 +384,7 @@ class InputManager:
def get_prev_shortcut(self): def get_prev_shortcut(self):
shortcut = [] shortcut = []
shortcut.append(self.env["input"]["shortcut_repeat"]) shortcut.append(self.env["input"]["shortcut_repeat"])
shortcut.append(self.env["input"]["prevInput"]) shortcut.append(self.env["input"]["prev_input"])
return str(shortcut) return str(shortcut)
def get_curr_shortcut(self, inputSequence=None): def get_curr_shortcut(self, inputSequence=None):
@@ -430,16 +430,16 @@ class InputManager:
if not self.env["runtime"][ if not self.env["runtime"][
"CursorManager" "CursorManager"
].should_process_numpad_commands(): ].should_process_numpad_commands():
for key in self.env["input"]["currInput"]: for key in self.env["input"]["curr_input"]:
if key in numpad_keys: if key in numpad_keys:
# Return an empty/invalid shortcut that won't match any # Return an empty/invalid shortcut that won't match any
# command # command
return "[]" return "[]"
shortcut.append(self.env["input"]["currInput"]) shortcut.append(self.env["input"]["curr_input"])
if len(self.env["input"]["prevInput"]) < len( if len(self.env["input"]["prev_input"]) < len(
self.env["input"]["currInput"] self.env["input"]["curr_input"]
): ):
if self.env["input"][ if self.env["input"][
"shortcut_repeat" "shortcut_repeat"
@@ -447,7 +447,7 @@ class InputManager:
shortcut = [] shortcut = []
self.env["input"]["shortcut_repeat"] = 1 self.env["input"]["shortcut_repeat"] = 1
shortcut.append(self.env["input"]["shortcut_repeat"]) shortcut.append(self.env["input"]["shortcut_repeat"])
shortcut.append(self.env["input"]["currInput"]) shortcut.append(self.env["input"]["curr_input"])
self.env["runtime"]["DebugManager"].write_debug_out( self.env["runtime"]["DebugManager"].write_debug_out(
"curr_shortcut " + str(shortcut), debug.DebugLevel.INFO "curr_shortcut " + str(shortcut), debug.DebugLevel.INFO
) )
@@ -456,15 +456,15 @@ class InputManager:
def curr_key_is_modifier(self): def curr_key_is_modifier(self):
if len(self.get_last_deepest_input()) != 1: if len(self.get_last_deepest_input()) != 1:
return False return False
return (self.env["input"]["currInput"][0] == "KEY_FENRIR") or ( return (self.env["input"]["curr_input"][0] == "KEY_FENRIR") or (
self.env["input"]["currInput"][0] == "KEY_SCRIPT" self.env["input"]["curr_input"][0] == "KEY_SCRIPT"
) )
def is_fenrir_key(self, event_name): def is_fenrir_key(self, event_name):
return event_name in self.env["input"]["fenrirKey"] return event_name in self.env["input"]["fenrir_key"]
def is_script_key(self, event_name): def is_script_key(self, event_name):
return event_name in self.env["input"]["scriptKey"] return event_name in self.env["input"]["script_key"]
def get_command_for_shortcut(self, shortcut): def get_command_for_shortcut(self, shortcut):
if not self.shortcut_exists(shortcut): if not self.shortcut_exists(shortcut):
@@ -477,8 +477,8 @@ class InputManager:
if not event_data: if not event_data:
return return
key_name = "" key_name = ""
if event_data["EventState"] == 1: if event_data["event_state"] == 1:
key_name = event_data["EventName"].lower() key_name = event_data["event_name"].lower()
if key_name.startswith("key_"): if key_name.startswith("key_"):
key_name = key_name[4:] key_name = key_name[4:]
self.env["runtime"]["OutputManager"].present_text( self.env["runtime"]["OutputManager"].present_text(
@@ -572,7 +572,7 @@ class InputManager:
# Get current layout path # Get current layout path
layout_setting = self.env["runtime"]["SettingsManager"].get_setting( layout_setting = self.env["runtime"]["SettingsManager"].get_setting(
"keyboard", "keyboardLayout" "keyboard", "keyboard_layout"
) )
# Resolve full path if needed # Resolve full path if needed
+26 -8
View File
@@ -49,7 +49,7 @@ class OutputManager:
return return
if ( if (
self.env["runtime"]["SettingsManager"].get_setting_as_bool( self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"speech", "readNumbersAsDigits" "speech", "read_numbers_as_digits"
) )
and len(text.strip()) > 1 and len(text.strip()) > 1
): ):
@@ -65,13 +65,31 @@ class OutputManager:
return return
if (len(text) > 1) and (text.strip(string.whitespace) == ""): if (len(text) > 1) and (text.strip(string.whitespace) == ""):
return return
to_announce_capital = announce_capital and text[0].isupper() is_capital = announce_capital and text[0].isupper()
if to_announce_capital: use_pitch_for_capital = False
if self.play_sound_icon("capital", False):
to_announce_capital = False if is_capital:
indicator = self.env["runtime"]["SettingsManager"].get_setting(
"speech", "capital_indicator"
).lower()
if indicator == "none":
pass # No indication
elif indicator == "beep":
# Play beep with interrupt=True to fix stacking
self.play_sound_icon("capital", True)
elif indicator == "pitch":
use_pitch_for_capital = True
elif indicator == "both":
self.play_sound_icon("capital", True)
use_pitch_for_capital = True
else:
# Default to pitch for unknown values
use_pitch_for_capital = True
self.last_echo = text self.last_echo = text
self.speak_text( self.speak_text(
text, interrupt, ignore_punctuation, to_announce_capital, flush text, interrupt, ignore_punctuation, use_pitch_for_capital, flush
) )
def get_last_echo(self): def get_last_echo(self):
@@ -157,7 +175,7 @@ class OutputManager:
self.env["runtime"]["SpeechDriver"].set_pitch( self.env["runtime"]["SpeechDriver"].set_pitch(
self.env["runtime"][ self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_float("speech", "capitalPitch") ].get_setting_as_float("speech", "capital_pitch")
) )
else: else:
self.env["runtime"]["SpeechDriver"].set_pitch( self.env["runtime"]["SpeechDriver"].set_pitch(
@@ -221,7 +239,7 @@ class OutputManager:
try: try:
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"general", "newLinePause" "general", "new_line_pause"
): ):
clean_text = text.replace("\n", " , ") clean_text = text.replace("\n", " , ")
else: else:
@@ -52,7 +52,7 @@ class PunctuationManager:
# Check if we should replace undefined punctuation with spaces # Check if we should replace undefined punctuation with spaces
replace_with_space = self.env["runtime"]["SettingsManager"].get_setting_as_bool( 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) # If the setting is disabled, use the old behavior (remove completely)
@@ -128,7 +128,7 @@ class PunctuationManager:
) and key not in " ": ) and key not in " ":
if ( if (
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "respectPunctuationPause" "general", "respect_punctuation_pause"
) )
and len(key) == 1 and len(key) == 1
and key in "',.;:?!" and key in "',.;:?!"
@@ -161,13 +161,13 @@ class PunctuationManager:
curr_punct_level = "" curr_punct_level = ""
if ( if (
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("general", "punctuationLevel") .get_setting("general", "punctuation_level")
.lower() .lower()
in self.env["punctuation"]["LEVELDICT"] in self.env["punctuation"]["LEVELDICT"]
): ):
curr_punct_level = self.env["punctuation"]["LEVELDICT"][ curr_punct_level = self.env["punctuation"]["LEVELDICT"][
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("general", "punctuationLevel") .get_setting("general", "punctuation_level")
.lower() .lower()
] ]
else: else:
@@ -183,7 +183,7 @@ class PunctuationManager:
try: try:
curr_index = punct_list.index( curr_index = punct_list.index(
self.env["runtime"]["SettingsManager"] self.env["runtime"]["SettingsManager"]
.get_setting("general", "punctuationLevel") .get_setting("general", "punctuation_level")
.lower() .lower()
) # curr punctuation ) # curr punctuation
except Exception as e: except Exception as e:
@@ -193,7 +193,7 @@ class PunctuationManager:
curr_index = 0 curr_index = 0
curr_level = punct_list[curr_index] curr_level = punct_list[curr_index]
self.env["runtime"]["SettingsManager"].set_setting( self.env["runtime"]["SettingsManager"].set_setting(
"general", "punctuationLevel", curr_level.lower() "general", "punctuation_level", curr_level.lower()
) )
return True return True
@@ -236,7 +236,7 @@ class QuickMenuManager(SpeechHelperMixin):
# Load base menu from config # Load base menu from config
menu_string = self.env["runtime"]["SettingsManager"].get_setting( menu_string = self.env["runtime"]["SettingsManager"].get_setting(
"menu", "quickMenu" "menu", "quick_menu"
) )
# Dynamically add speech-dispatcher specific items # Dynamically add speech-dispatcher specific items
+5 -5
View File
@@ -69,7 +69,7 @@ class RemoteManager:
def handle_settings_change_with_response(self, settings_text): def handle_settings_change_with_response(self, settings_text):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"remote", "enableSettingsRemote" "remote", "enable_settings_remote"
): ):
return { return {
"success": False, "success": False,
@@ -115,7 +115,7 @@ class RemoteManager:
def handle_settings_change(self, settings_text): def handle_settings_change(self, settings_text):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"remote", "enableSettingsRemote" "remote", "enable_settings_remote"
): ):
return return
@@ -137,7 +137,7 @@ class RemoteManager:
def handle_command_execution_with_response(self, command_text): def handle_command_execution_with_response(self, command_text):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"remote", "enableCommandRemote" "remote", "enable_command_remote"
): ):
return { return {
"success": False, "success": False,
@@ -218,7 +218,7 @@ class RemoteManager:
def handle_command_execution(self, command_text): def handle_command_execution(self, command_text):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"remote", "enableCommandRemote" "remote", "enable_command_remote"
): ):
return return
@@ -309,7 +309,7 @@ class RemoteManager:
def export_clipboard(self): def export_clipboard(self):
clipboard_file_path = self.env["runtime"][ clipboard_file_path = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("general", "clipboardExportPath") ].get_setting("general", "clipboard_export_path")
clipboard_file_path = clipboard_file_path.replace( clipboard_file_path = clipboard_file_path.replace(
"$user", self.env["general"]["curr_user"] "$user", self.env["general"]["curr_user"]
) )
+2 -2
View File
@@ -429,11 +429,11 @@ class ScreenManager:
ignore_screens = [] ignore_screens = []
fix_ignore_screens = self.env["runtime"][ fix_ignore_screens = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("screen", "ignoreScreen") ].get_setting("screen", "ignore_screen")
if fix_ignore_screens != "": if fix_ignore_screens != "":
ignore_screens.extend(fix_ignore_screens.split(",")) ignore_screens.extend(fix_ignore_screens.split(","))
if self.env["runtime"]["SettingsManager"].get_setting_as_bool( if self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"screen", "autodetectIgnoreScreen" "screen", "autodetect_ignore_screen"
): ):
ignore_screens.extend(self.env["screen"]["autoIgnoreScreens"]) ignore_screens.extend(self.env["screen"]["autoIgnoreScreens"])
self.env["runtime"]["DebugManager"].write_debug_out( self.env["runtime"]["DebugManager"].write_debug_out(
+47 -49
View File
@@ -12,59 +12,62 @@ settings_data = {
"driver": "genericDriver", "driver": "genericDriver",
"theme": "default", "theme": "default",
"volume": 1.0, "volume": 1.0,
"genericPlayFileCommand": "play -q -v fenrirVolume fenrirSoundFile", "generic_play_file_command": "play -q -v fenrirVolume fenrirSoundFile",
"genericFrequencyCommand": "play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence", "generic_frequency_command": "play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence",
"progress_monitoring": True,
}, },
"speech": { "speech": {
"enabled": True, "enabled": True,
"driver": "genericDriver", "driver": "genericDriver",
"serverPath": "", "server_path": "",
"rate": 0.75, "rate": 0.75,
"pitch": 0.5, "pitch": 0.5,
"capitalPitch": 0.8, "capital_pitch": 0.8,
"capital_indicator": "pitch",
"volume": 1.0, "volume": 1.0,
"module": "", "module": "",
"voice": "en-us", "voice": "en-us",
"language": "", "language": "",
"autoReadIncoming": True, "auto_read_incoming": True,
"readNumbersAsDigits": False, "read_numbers_as_digits": False,
"genericSpeechCommand": 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"', "generic_speech_command": 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice "fenrirText"',
"fenrirMinVolume": 0, "fenrir_min_volume": 0,
"fenrirMaxVolume": 200, "fenrir_max_volume": 200,
"fenrirMinPitch": 0, "fenrir_min_pitch": 0,
"fenrirMaxPitch": 99, "fenrir_max_pitch": 99,
"fenrirMinRate": 80, "fenrir_min_rate": 80,
"fenrirMaxRate": 450, "fenrir_max_rate": 450,
}, },
"screen": { "screen": {
"driver": "vcsaDriver", "driver": "vcsaDriver",
"encoding": "auto", "encoding": "auto",
"screenUpdateDelay": 0.1, "screen_update_delay": 0.1,
"ignoreScreen": "", "ignore_screen": "",
"autodetectIgnoreScreen": False, "autodetect_ignore_screen": False,
}, },
"general": { "general": {
"debug_level": debug.DebugLevel.DEACTIVE, "debug_level": debug.DebugLevel.DEACTIVE,
"debug_mode": "FILE", "debug_mode": "FILE",
"debugFile": "", "debug_file": "",
"punctuationProfile": "default", "punctuation_profile": "default",
"punctuationLevel": "some", "punctuation_level": "some",
"respectPunctuationPause": True, "respect_punctuation_pause": True,
"replaceUndefinedPunctuationWithSpace": True, "replace_undefined_punctuation_with_space": True,
"newLinePause": True, "new_line_pause": True,
"numberOfClipboards": 10, "number_of_clipboards": 10,
"clipboard_export_path": "/tmp/fenrirClipboard",
"emoticons": True, "emoticons": True,
"fenrirKeys": "KEY_KP0,KEY_META", "fenrir_keys": "KEY_KP0,KEY_META",
"scriptKeys": "KEY_COMPOSE", "script_keys": "KEY_COMPOSE",
"time_format": "%I:%M%P", "time_format": "%I:%M%P",
"date_format": "%A, %B %d, %Y", "date_format": "%A, %B %d, %Y",
"autoSpellCheck": False, "auto_spell_check": False,
"spellCheckLanguage": "en_US", "spell_check_language": "en_US",
"script_path": "/usr/share/fenrirscreenreader/scripts", "script_path": "/usr/share/fenrirscreenreader/scripts",
"command_path": "/usr/share/fenrirscreenreader/commands", "command_path": "/usr/share/fenrirscreenreader/commands",
"attribute_format_string": "Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize", "attribute_format_string": "Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize",
"autoPresentIndent": False, "auto_present_indent": False,
"autoPresentIndentMode": 1, "auto_present_indent_mode": 1,
"has_attributes": True, "has_attributes": True,
"shell": "", "shell": "",
}, },
@@ -77,8 +80,8 @@ settings_data = {
"driver": "unixDriver", "driver": "unixDriver",
"port": 22447, "port": 22447,
"socket_file": "", "socket_file": "",
"enableSettingsRemote": True, "enable_settings_remote": True,
"enableCommandRemote": True, "enable_command_remote": True,
}, },
"barrier": { "barrier": {
"enabled": True, "enabled": True,
@@ -88,17 +91,12 @@ settings_data = {
"review": { "review": {
"line_break": True, "line_break": True,
"end_of_screen": True, "end_of_screen": True,
"leaveReviewOnCursorChange": True, "leave_review_on_cursor_change": True,
"leaveReviewOnScreenChange": True, "leave_review_on_screen_change": True,
}, },
"menu": { "menu": {
"vmenuPath": "", "vmenu_path": "",
"quickMenu": "speech#rate;speech#pitch;speech#volume", "quick_menu": "speech#rate;speech#pitch;speech#volume",
},
"promote": {
"enabled": True,
"inactiveTimeoutSec": 120,
"list": "",
}, },
"time": { "time": {
"enabled": False, "enabled": False,
@@ -112,14 +110,14 @@ settings_data = {
"keyboard": { "keyboard": {
"driver": "evdev", "driver": "evdev",
"device": "all", "device": "all",
"grabDevices": True, "grab_devices": True,
"ignoreShortcuts": False, "ignore_shortcuts": False,
"keyboardLayout": "desktop", "keyboard_layout": "desktop",
"charEchoMode": 2, # while capslock "char_echo_mode": 2, # while capslock
"charDeleteEcho": True, "char_delete_echo": True,
"wordEcho": True, "word_echo": True,
"interruptOnKeyPress": True, "interrupt_on_key_press": True,
"interruptOnKeyPressFilter": "", "interrupt_on_key_press_filter": "",
"doubleTapTimeout": 0.2, "double_tap_timeout": 0.2,
}, },
} }
+40 -40
View File
@@ -282,15 +282,15 @@ class SettingsManager:
keys = keys.upper() keys = keys.upper()
key_list = keys.split(",") key_list = keys.split(",")
for key in key_list: for key in key_list:
if key not in self.env["input"]["fenrirKey"]: if key not in self.env["input"]["fenrir_key"]:
self.env["input"]["fenrirKey"].append(key) self.env["input"]["fenrir_key"].append(key)
def set_script_keys(self, keys): def set_script_keys(self, keys):
keys = keys.upper() keys = keys.upper()
key_list = keys.split(",") key_list = keys.split(",")
for key in key_list: for key in key_list:
if key not in self.env["input"]["scriptKey"]: if key not in self.env["input"]["script_key"]:
self.env["input"]["scriptKey"].append(key) self.env["input"]["script_key"].append(key)
def reset_setting_arg_dict(self): def reset_setting_arg_dict(self):
self.settingArgDict = {} self.settingArgDict = {}
@@ -498,7 +498,7 @@ class SettingsManager:
# Set PTY driver settings # Set PTY driver settings
pty_settings = { pty_settings = {
"screen": {"driver": "ptyDriver"}, "screen": {"driver": "ptyDriver"},
"keyboard": {"driver": "ptyDriver", "keyboardLayout": "pty"} "keyboard": {"driver": "ptyDriver", "keyboard_layout": "pty"}
} }
for section, settings in pty_settings.items(): for section, settings in pty_settings.items():
for key, value in settings.items(): for key, value in settings.items():
@@ -507,12 +507,12 @@ class SettingsManager:
self.set_setting("screen", "driver", "ptyDriver") self.set_setting("screen", "driver", "ptyDriver")
self.set_setting("keyboard", "driver", "evdevDriver") self.set_setting("keyboard", "driver", "evdevDriver")
self.set_fenrir_keys(self.get_setting("general", "fenrirKeys")) self.set_fenrir_keys(self.get_setting("general", "fenrir_keys"))
self.set_script_keys(self.get_setting("general", "scriptKeys")) self.set_script_keys(self.get_setting("general", "script_keys"))
environment["runtime"]["DebugManager"] = debugManager.DebugManager( environment["runtime"]["DebugManager"] = debugManager.DebugManager(
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"general", "debugFile" "general", "debug_file"
) )
) )
environment["runtime"]["DebugManager"].initialize(environment) environment["runtime"]["DebugManager"].initialize(environment)
@@ -521,7 +521,7 @@ class SettingsManager:
environment["runtime"]["force_all_screens"] = True environment["runtime"]["force_all_screens"] = True
if cliArgs.ignore_screen: 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: if current_ignore_screen:
ignore_screens = ( ignore_screens = (
current_ignore_screen.split(",") + cliArgs.ignore_screen current_ignore_screen.split(",") + cliArgs.ignore_screen
@@ -529,7 +529,7 @@ class SettingsManager:
else: else:
ignore_screens = cliArgs.ignore_screen ignore_screens = cliArgs.ignore_screen
self.set_setting( self.set_setting(
"screen", "ignoreScreen", ",".join(ignore_screens) "screen", "ignore_screen", ",".join(ignore_screens)
) )
if not os.path.exists( if not os.path.exists(
@@ -561,43 +561,43 @@ class SettingsManager:
environment["runtime"]["TextManager"].initialize(environment) environment["runtime"]["TextManager"].initialize(environment)
if not os.path.exists( if not os.path.exists(
self.get_setting("general", "punctuationProfile") self.get_setting("general", "punctuation_profile")
): ):
if os.path.exists( if os.path.exists(
settings_root settings_root
+ "punctuation/" + "punctuation/"
+ self.get_setting("general", "punctuationProfile") + self.get_setting("general", "punctuation_profile")
): ):
self.set_setting( self.set_setting(
"general", "general",
"punctuationProfile", "punctuation_profile",
settings_root settings_root
+ "punctuation/" + "punctuation/"
+ self.get_setting("general", "punctuationProfile"), + self.get_setting("general", "punctuation_profile"),
) )
environment["runtime"]["PunctuationManager"].load_dicts( environment["runtime"]["PunctuationManager"].load_dicts(
self.get_setting("general", "punctuationProfile") self.get_setting("general", "punctuation_profile")
) )
if os.path.exists( if os.path.exists(
settings_root settings_root
+ "punctuation/" + "punctuation/"
+ self.get_setting("general", "punctuationProfile") + self.get_setting("general", "punctuation_profile")
+ ".conf" + ".conf"
): ):
self.set_setting( self.set_setting(
"general", "general",
"punctuationProfile", "punctuation_profile",
settings_root settings_root
+ "punctuation/" + "punctuation/"
+ self.get_setting("general", "punctuationProfile") + self.get_setting("general", "punctuation_profile")
+ ".conf", + ".conf",
) )
environment["runtime"]["PunctuationManager"].load_dicts( environment["runtime"]["PunctuationManager"].load_dicts(
self.get_setting("general", "punctuationProfile") self.get_setting("general", "punctuation_profile")
) )
else: else:
environment["runtime"]["PunctuationManager"].load_dicts( environment["runtime"]["PunctuationManager"].load_dicts(
self.get_setting("general", "punctuationProfile") self.get_setting("general", "punctuation_profile")
) )
if fenrir_manager: if fenrir_manager:
@@ -644,86 +644,86 @@ class SettingsManager:
if environment["runtime"]["InputManager"].get_shortcut_type() == "KEY": if environment["runtime"]["InputManager"].get_shortcut_type() == "KEY":
if not os.path.exists( if not os.path.exists(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
): ):
if os.path.exists( if os.path.exists(
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout") + self.get_setting("keyboard", "keyboard_layout")
): ):
self.set_setting( self.set_setting(
"keyboard", "keyboard",
"keyboardLayout", "keyboard_layout",
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout"), + self.get_setting("keyboard", "keyboard_layout"),
) )
environment["runtime"]["InputManager"].load_shortcuts( environment["runtime"]["InputManager"].load_shortcuts(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
) )
if os.path.exists( if os.path.exists(
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout") + self.get_setting("keyboard", "keyboard_layout")
+ ".conf" + ".conf"
): ):
self.set_setting( self.set_setting(
"keyboard", "keyboard",
"keyboardLayout", "keyboard_layout",
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout") + self.get_setting("keyboard", "keyboard_layout")
+ ".conf", + ".conf",
) )
environment["runtime"]["InputManager"].load_shortcuts( environment["runtime"]["InputManager"].load_shortcuts(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
) )
else: else:
environment["runtime"]["InputManager"].load_shortcuts( environment["runtime"]["InputManager"].load_shortcuts(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
) )
elif ( elif (
environment["runtime"]["InputManager"].get_shortcut_type() environment["runtime"]["InputManager"].get_shortcut_type()
== "BYTE" == "BYTE"
): ):
if not os.path.exists( if not os.path.exists(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
): ):
if os.path.exists( if os.path.exists(
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout") + self.get_setting("keyboard", "keyboard_layout")
): ):
self.set_setting( self.set_setting(
"keyboard", "keyboard",
"keyboardLayout", "keyboard_layout",
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout"), + self.get_setting("keyboard", "keyboard_layout"),
) )
environment["runtime"]["ByteManager"].load_byte_shortcuts( environment["runtime"]["ByteManager"].load_byte_shortcuts(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
) )
if os.path.exists( if os.path.exists(
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout") + self.get_setting("keyboard", "keyboard_layout")
+ ".conf" + ".conf"
): ):
self.set_setting( self.set_setting(
"keyboard", "keyboard",
"keyboardLayout", "keyboard_layout",
settings_root settings_root
+ "keyboard/" + "keyboard/"
+ self.get_setting("keyboard", "keyboardLayout") + self.get_setting("keyboard", "keyboard_layout")
+ ".conf", + ".conf",
) )
environment["runtime"]["ByteManager"].load_byte_shortcuts( environment["runtime"]["ByteManager"].load_byte_shortcuts(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
) )
else: else:
environment["runtime"]["ByteManager"].load_byte_shortcuts( environment["runtime"]["ByteManager"].load_byte_shortcuts(
self.get_setting("keyboard", "keyboardLayout") self.get_setting("keyboard", "keyboard_layout")
) )
environment["runtime"]["CursorManager"] = cursorManager.CursorManager() environment["runtime"]["CursorManager"] = cursorManager.CursorManager()
+2 -2
View File
@@ -40,13 +40,13 @@ class VmenuManager:
# if there is no user configuration # if there is no user configuration
if ( if (
self.env["runtime"]["SettingsManager"].get_setting( self.env["runtime"]["SettingsManager"].get_setting(
"menu", "vmenuPath" "menu", "vmenu_path"
) )
!= "" != ""
): ):
self.defaultVMenuPath = self.env["runtime"][ self.defaultVMenuPath = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("menu", "vmenuPath") ].get_setting("menu", "vmenu_path")
if not self.defaultVMenuPath.endswith("/"): if not self.defaultVMenuPath.endswith("/"):
self.defaultVMenuPath += "/" self.defaultVMenuPath += "/"
self.defaultVMenuPath += self.env["runtime"][ self.defaultVMenuPath += self.env["runtime"][
+1 -1
View File
@@ -4,5 +4,5 @@
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributors. # By Chrys, Storm Dragon, and contributors.
version = "2025.12.03" version = "2025.12.30"
code_name = "master" code_name = "master"
@@ -41,7 +41,7 @@ class driver(inputDriver):
def clear_event_buffer(self): def clear_event_buffer(self):
if not self._initialized: if not self._initialized:
return return
del self.env["input"]["eventBuffer"][:] del self.env["input"]["event_buffer"][:]
print("Input Debug Driver: clear_event_buffer") print("Input Debug Driver: clear_event_buffer")
def update_input_devices(self, new_devices=None, init=False): def update_input_devices(self, new_devices=None, init=False):
@@ -259,7 +259,7 @@ class driver(inputDriver):
"input_watchdog: EVENT:" + str(event), "input_watchdog: EVENT:" + str(event),
debug.DebugLevel.INFO, debug.DebugLevel.INFO,
) )
self.env["input"]["eventBuffer"].append( self.env["input"]["event_buffer"].append(
[device, udevice, event] [device, udevice, event]
) )
if event.type == evdev.events.EV_KEY: if event.type == evdev.events.EV_KEY:
@@ -271,11 +271,11 @@ class driver(inputDriver):
event = device.read_one() event = device.read_one()
continue continue
if not isinstance( if not isinstance(
curr_map_event["EventName"], str curr_map_event["event_name"], str
): ):
event = device.read_one() event = device.read_one()
continue continue
if curr_map_event["EventState"] in [0, 1, 2]: if curr_map_event["event_state"] in [0, 1, 2]:
event_queue.put( event_queue.put(
{ {
"Type": FenrirEventType.keyboard_input, "Type": FenrirEventType.keyboard_input,
@@ -284,7 +284,8 @@ class driver(inputDriver):
) )
event_fired = True event_fired = True
else: 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 foreward = True
event = device.read_one() event = device.read_one()
@@ -300,7 +301,7 @@ class driver(inputDriver):
def write_event_buffer(self): def write_event_buffer(self):
if not self._initialized: if not self._initialized:
return return
for iDevice, uDevice, event in self.env["input"]["eventBuffer"]: for iDevice, uDevice, event in self.env["input"]["event_buffer"]:
try: try:
if uDevice: if uDevice:
if self.gDevices[iDevice.fd]: if self.gDevices[iDevice.fd]:
@@ -553,18 +554,18 @@ class driver(inputDriver):
m_event = inputData.input_event m_event = inputData.input_event
try: try:
# mute is a list = ['KEY_MIN_INTERESTING', 'KEY_MUTE'] # mute is a list = ['KEY_MIN_INTERESTING', 'KEY_MUTE']
m_event["EventName"] = evdev.ecodes.keys[event.code] m_event["event_name"] = evdev.ecodes.keys[event.code]
if isinstance(m_event["EventName"], list): if isinstance(m_event["event_name"], list):
if len(m_event["EventName"]) > 0: if len(m_event["event_name"]) > 0:
m_event["EventName"] = m_event["EventName"][0] m_event["event_name"] = m_event["event_name"][0]
if isinstance(m_event["EventName"], list): if isinstance(m_event["event_name"], list):
if len(m_event["EventName"]) > 0: if len(m_event["event_name"]) > 0:
m_event["EventName"] = m_event["EventName"][0] m_event["event_name"] = m_event["event_name"][0]
m_event["EventValue"] = event.code m_event["event_value"] = event.code
m_event["EventSec"] = event.sec m_event["event_sec"] = event.sec
m_event["EventUsec"] = event.usec m_event["event_usec"] = event.usec
m_event["EventState"] = event.value m_event["event_state"] = event.value
m_event["EventType"] = event.type m_event["event_type"] = event.type
return m_event return m_event
except Exception as e: except Exception as e:
return None return None
@@ -622,7 +623,7 @@ class driver(inputDriver):
def create_u_input_dev(self, fd): def create_u_input_dev(self, fd):
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
self.uDevices[fd] = None self.uDevices[fd] = None
return return
@@ -729,7 +730,7 @@ class driver(inputDriver):
Only effective if grabDevices setting is enabled. Only effective if grabDevices setting is enabled.
""" """
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
return True return True
@@ -791,7 +792,7 @@ class driver(inputDriver):
bool: True if ungrab successful, False otherwise bool: True if ungrab successful, False otherwise
""" """
if not self.env["runtime"]["SettingsManager"].get_setting_as_bool( if not self.env["runtime"]["SettingsManager"].get_setting_as_bool(
"keyboard", "grabDevices" "keyboard", "grab_devices"
): ):
return True return True
@@ -48,10 +48,10 @@ class driver(sound_driver):
self.env = environment self.env = environment
self.soundFileCommand = self.env["runtime"][ self.soundFileCommand = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("sound", "genericPlayFileCommand") ].get_setting("sound", "generic_play_file_command")
self.frequenceCommand = self.env["runtime"][ self.frequenceCommand = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("sound", "genericFrequencyCommand") ].get_setting("sound", "generic_frequency_command")
if self.soundFileCommand == "": if self.soundFileCommand == "":
self.soundFileCommand = "play -q -v fenrirVolume fenrirSoundFile" self.soundFileCommand = "play -q -v fenrirVolume fenrirSoundFile"
if self.frequenceCommand == "": if self.frequenceCommand == "":
@@ -38,26 +38,26 @@ class driver(speech_driver):
self.env = environment self.env = environment
self.minVolume = self.env["runtime"][ self.minVolume = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_int("speech", "fenrirMinVolume") ].get_setting_as_int("speech", "fenrir_min_volume")
self.maxVolume = self.env["runtime"][ self.maxVolume = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_int("speech", "fenrirMaxVolume") ].get_setting_as_int("speech", "fenrir_max_volume")
self.minPitch = self.env["runtime"][ self.minPitch = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_int("speech", "fenrirMinPitch") ].get_setting_as_int("speech", "fenrir_min_pitch")
self.maxPitch = self.env["runtime"][ self.maxPitch = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_int("speech", "fenrirMaxPitch") ].get_setting_as_int("speech", "fenrir_max_pitch")
self.minRate = self.env["runtime"][ self.minRate = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_int("speech", "fenrirMinRate") ].get_setting_as_int("speech", "fenrir_min_rate")
self.maxRate = self.env["runtime"][ self.maxRate = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting_as_int("speech", "fenrirMaxRate") ].get_setting_as_int("speech", "fenrir_max_rate")
self.speechCommand = self.env["runtime"][ self.speechCommand = self.env["runtime"][
"SettingsManager" "SettingsManager"
].get_setting("speech", "genericSpeechCommand") ].get_setting("speech", "generic_speech_command")
if self.speechCommand == "": if self.speechCommand == "":
self.speechCommand = 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText"' self.speechCommand = 'espeak -a fenrirVolume -s fenrirRate -p fenrirPitch -v fenrirVoice -- "fenrirText"'
if False: # for debugging overwrite here if False: # for debugging overwrite here