Fixed the -x keyboard problem for real this time I'm pretty sure.
This commit is contained in:
@@ -164,7 +164,7 @@ class SpeechHistoryManager:
|
||||
str([1, ["KEY_KPENTER"]]): "SPEECH_HISTORY_COPY",
|
||||
str([1, ["KEY_ESC"]]): "SPEECH_HISTORY_CLOSE",
|
||||
}
|
||||
self.env["rawBindings"] = {
|
||||
modal_raw_bindings = {
|
||||
str([1, ["KEY_UP"]]): [1, ["KEY_UP"]],
|
||||
str([1, ["KEY_DOWN"]]): [1, ["KEY_DOWN"]],
|
||||
str([1, ["KEY_SPACE"]]): [1, ["KEY_SPACE"]],
|
||||
@@ -172,6 +172,8 @@ class SpeechHistoryManager:
|
||||
str([1, ["KEY_KPENTER"]]): [1, ["KEY_KPENTER"]],
|
||||
str([1, ["KEY_ESC"]]): [1, ["KEY_ESC"]],
|
||||
}
|
||||
self.env["rawBindings"] = self.raw_bindings_backup.copy()
|
||||
self.env["rawBindings"].update(modal_raw_bindings)
|
||||
self._refresh_input_bindings()
|
||||
|
||||
def _restore_bindings(self):
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributors.
|
||||
|
||||
version = "2026.05.21"
|
||||
version = "2026.05.22"
|
||||
code_name = "testing"
|
||||
|
||||
@@ -94,6 +94,7 @@ def test_open_history_installs_modal_bindings_and_replay_is_not_recorded():
|
||||
manager, env, spoken_messages, _memory_manager = (
|
||||
build_speech_history_manager()
|
||||
)
|
||||
env["rawBindings"]["ctrl_shut_up"] = [1, ["KEY_CTRL"]]
|
||||
manager.add_text("first")
|
||||
manager.add_text("second")
|
||||
|
||||
@@ -105,10 +106,12 @@ def test_open_history_installs_modal_bindings_and_replay_is_not_recorded():
|
||||
assert manager.curr_index == -1
|
||||
assert manager.history == ["second", "first"]
|
||||
assert "original" not in env["bindings"]
|
||||
assert "original" not in env["rawBindings"]
|
||||
assert env["rawBindings"]["original"] == [1, ["KEY_FENRIR"]]
|
||||
assert env["rawBindings"]["ctrl_shut_up"] == [1, ["KEY_CTRL"]]
|
||||
assert env["bindings"][str([1, ["KEY_UP"]])] == "SPEECH_HISTORY_PREV"
|
||||
assert env["bindings"][str([1, ["KEY_ENTER"]])] == "SPEECH_HISTORY_COPY"
|
||||
assert env["bindings"][str([1, ["KEY_ESC"]])] == "SPEECH_HISTORY_CLOSE"
|
||||
assert env["rawBindings"][str([1, ["KEY_UP"]])] == [1, ["KEY_UP"]]
|
||||
input_driver = env["runtime"]["InputDriver"]
|
||||
input_driver.refresh_grabs.assert_called_once_with(force=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user