Another attempt at fixing external numpad detection. I *think* some of them send numlock state with every event. If that's the case, this should fix it.
This commit is contained in:
@@ -24,11 +24,22 @@ class command:
|
||||
def run(self):
|
||||
if self.env["input"]["oldNumLock"] == self.env["input"]["newNumLock"]:
|
||||
return
|
||||
|
||||
|
||||
# Only announce numlock changes if an actual numlock key was pressed
|
||||
# This prevents spurious announcements from external numpad automatic state changes
|
||||
# AND the LED state actually changed (some numpads send spurious NUMLOCK events)
|
||||
current_input = self.env["input"]["currInput"]
|
||||
if current_input and "KEY_NUMLOCK" in current_input:
|
||||
|
||||
# Check if this is a genuine numlock key press by verifying:
|
||||
# 1. KEY_NUMLOCK is in the current input sequence
|
||||
# 2. The LED state has actually changed
|
||||
# 3. This isn't just a side effect from a KP_ key (which some buggy numpads do)
|
||||
is_genuine_numlock = (
|
||||
current_input and
|
||||
"KEY_NUMLOCK" in current_input and
|
||||
not any(key.startswith("KEY_KP") for key in current_input if isinstance(key, str))
|
||||
)
|
||||
|
||||
if is_genuine_numlock:
|
||||
if self.env["input"]["newNumLock"]:
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("Numlock on"), interrupt=True
|
||||
|
@@ -159,8 +159,7 @@ class command(config_command):
|
||||
|
||||
except Exception as e:
|
||||
self.present_text(
|
||||
f"Failed to create default configuration: {
|
||||
str(e)}",
|
||||
f"Failed to create default configuration: {str(e)}",
|
||||
interrupt=False,
|
||||
flush=False,
|
||||
)
|
||||
|
@@ -45,8 +45,7 @@ class command:
|
||||
sound_driver.initialize(self.env)
|
||||
except Exception as e:
|
||||
print(
|
||||
f"revert_to_saved sound_driver: Error reinitializing sound driver: {
|
||||
str(e)}"
|
||||
f"revert_to_saved sound_driver: Error reinitializing sound driver: {str(e)}"
|
||||
)
|
||||
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
|
@@ -189,9 +189,7 @@ class DynamicApplyVoiceCommand:
|
||||
|
||||
# Debug: verify what was actually set
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
f"Speech driver now has module: {
|
||||
SpeechDriver.module}, voice: {
|
||||
SpeechDriver.voice}",
|
||||
f"Speech driver now has module: {SpeechDriver.module}, voice: {SpeechDriver.voice}",
|
||||
interrupt=True,
|
||||
)
|
||||
|
||||
@@ -233,8 +231,7 @@ class DynamicApplyVoiceCommand:
|
||||
)
|
||||
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
f"Failed to apply voice, reverted: {
|
||||
str(e)}",
|
||||
f"Failed to apply voice, reverted: {str(e)}",
|
||||
interrupt=False,
|
||||
flush=False,
|
||||
)
|
||||
|
@@ -4,5 +4,5 @@
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributors.
|
||||
|
||||
version = "2025.09.12"
|
||||
version = "2025.09.13"
|
||||
code_name = "testing"
|
||||
|
Reference in New Issue
Block a user