diff --git a/core/addon_communication/ipc_client.py b/core/addon_communication/ipc_client.py index 3cfa42b..e8ca516 100644 --- a/core/addon_communication/ipc_client.py +++ b/core/addon_communication/ipc_client.py @@ -43,10 +43,12 @@ def addon_server_endpoint() -> Tuple[str, str, str]: return address, port, valid_commands - def send_ipc_commands(commands: list[str]): + def send_ipc_commands(commands: list[str] | str): """Sends a list of commands to the NVDA screenreader""" ip, port, valid_commands = actions.user.addon_server_endpoint() + if isinstance(commands, str): + commands = [commands] for command in commands: if command not in valid_commands: @@ -68,6 +70,8 @@ def send_ipc_commands(commands: list[str]): response = sock.recv(1024) if settings.get("user.addon_debug"): print('Received', repr(response)) + if command == ['debug'] or command == 'debug': + actions.user.tts("Sent Message to NVDA Successfully") except socket.timeout: print("NVDA Addon Connection timed out") except: @@ -86,5 +90,3 @@ def send_ipc_commands(commands: list[str]): JAWSContext.matches = r""" tag: user.jaws_running """ - - diff --git a/nvda/nvda.talon b/nvda/nvda.talon index 70bac3b..0538352 100644 --- a/nvda/nvda.talon +++ b/nvda/nvda.talon @@ -147,4 +147,4 @@ restart reader: user.restart_nvda() test reader add on: - user.send_ipc_command("debug") + user.send_ipc_commands("debug")