Another shot at fixing multiple numpads.

This commit is contained in:
Storm Dragon
2025-07-25 14:17:17 -04:00
parent 94a1acbaca
commit 84293db6dc
2 changed files with 14 additions and 9 deletions

View File

@ -24,14 +24,19 @@ class command:
def run(self): def run(self):
if self.env["input"]["oldNumLock"] == self.env["input"]["newNumLock"]: if self.env["input"]["oldNumLock"] == self.env["input"]["newNumLock"]:
return return
if self.env["input"]["newNumLock"]:
self.env["runtime"]["OutputManager"].present_text( # Only announce numlock changes if an actual numlock key was pressed
_("Numlock on"), interrupt=True # This prevents spurious announcements from external numpad automatic state changes
) current_input = self.env["input"]["currInput"]
else: if current_input and "KEY_NUMLOCK" in current_input:
self.env["runtime"]["OutputManager"].present_text( if self.env["input"]["newNumLock"]:
_("Numlock off"), interrupt=True self.env["runtime"]["OutputManager"].present_text(
) _("Numlock on"), interrupt=True
)
else:
self.env["runtime"]["OutputManager"].present_text(
_("Numlock off"), interrupt=True
)
def set_callback(self, callback): def set_callback(self, callback):
pass pass

View File

@ -4,6 +4,6 @@
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributors. # By Chrys, Storm Dragon, and contributors.
version = "2025.07.24" version = "2025.07.25"
codeName = "testing" codeName = "testing"
code_name = "testing" code_name = "testing"