Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ec90906052 | ||
|
f01374d15e | ||
|
0347b7feea | ||
|
0580dda131 |
@ -1 +0,0 @@
|
|||||||
See http://wiki.gnome.org/Projects/Cthulhu
|
|
@ -1,5 +1,10 @@
|
|||||||
# Cthulhu
|
# Cthulhu
|
||||||
|
|
||||||
|
## Note
|
||||||
|
|
||||||
|
If you somehow stumbled across this while looking for a desktop screen reader for Linux, you most likely want [Orca](https://orca.gnome.org/) instead. Cthulhu is currently a supplemental screen reader that fills a nitch for some advanced users. E.g. some older QT based programs may work with Cthulhu, and if you use certain window managers like i3, Mozilla applications like Firefox and Thunderbird may work better.
|
||||||
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
Cthulhu is a free, open source, flexible, and extensible screen reader
|
Cthulhu is a free, open source, flexible, and extensible screen reader
|
||||||
@ -20,7 +25,7 @@ Cthulhu has the following dependencies:
|
|||||||
|
|
||||||
* Python 3 - Python platform
|
* Python 3 - Python platform
|
||||||
* pygobject-3.0 - Python bindings for the GObject library
|
* pygobject-3.0 - Python bindings for the GObject library
|
||||||
* libpeas - GObject based Plugin engine
|
* pluggy - Plugin and hook calling mechanisms for python
|
||||||
* gtk+-3.0 - GTK+ toolkit
|
* gtk+-3.0 - GTK+ toolkit
|
||||||
* json-py - a JSON (<https://json.org/>) reader and writer in Python
|
* json-py - a JSON (<https://json.org/>) reader and writer in Python
|
||||||
* python-speechd - Python bindings for Speech Dispatcher (optional)
|
* python-speechd - Python bindings for Speech Dispatcher (optional)
|
||||||
@ -30,7 +35,6 @@ Cthulhu has the following dependencies:
|
|||||||
* py-setproctitle - Python library to set the process title (optional)
|
* py-setproctitle - Python library to set the process title (optional)
|
||||||
* gstreamer-1.0 - GStreamer - Streaming media framework (optional)
|
* gstreamer-1.0 - GStreamer - Streaming media framework (optional)
|
||||||
* socat - Used for self-voicing functionality.
|
* socat - Used for self-voicing functionality.
|
||||||
* libpeas - For the plugin system.
|
|
||||||
|
|
||||||
You are strongly encouraged to also have the latest stable versions
|
You are strongly encouraged to also have the latest stable versions
|
||||||
of AT-SPI2 and ATK.
|
of AT-SPI2 and ATK.
|
||||||
|
@ -47,9 +47,7 @@ class APIHelper:
|
|||||||
self.app = app
|
self.app = app
|
||||||
self._gestureBindings = {}
|
self._gestureBindings = {}
|
||||||
|
|
||||||
def registerGestureByString(self, function, name, gestureString,
|
def registerGestureByString(self, function, name, gestureString, inputEventType='default', normalizer='cthulhu', learnModeEnabled=True, contextName=None):
|
||||||
inputEventType='default', normalizer='cthulhu',
|
|
||||||
learnModeEnabled=True, contextName=None):
|
|
||||||
"""Register a gesture by string.
|
"""Register a gesture by string.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
@ -95,7 +93,12 @@ class APIHelper:
|
|||||||
self.description = description
|
self.description = description
|
||||||
|
|
||||||
def __call__(self, script, inputEvent):
|
def __call__(self, script, inputEvent):
|
||||||
return self.function(script, inputEvent)
|
try:
|
||||||
|
return function(script, inputEvent)
|
||||||
|
except Exception as e:
|
||||||
|
import logging
|
||||||
|
logging.getLogger(__name__).error(f"Error in keybinding handler: {e}")
|
||||||
|
return True
|
||||||
|
|
||||||
handler = GestureHandler(function, name)
|
handler = GestureHandler(function, name)
|
||||||
|
|
||||||
@ -108,6 +111,8 @@ class APIHelper:
|
|||||||
keybindings.defaultModifierMask,
|
keybindings.defaultModifierMask,
|
||||||
modifiers,
|
modifiers,
|
||||||
handler)
|
handler)
|
||||||
|
|
||||||
|
# Add the binding to the active script
|
||||||
bindings.add(binding)
|
bindings.add(binding)
|
||||||
|
|
||||||
# Store binding for later reference
|
# Store binding for later reference
|
||||||
@ -115,6 +120,13 @@ class APIHelper:
|
|||||||
self._gestureBindings[contextName] = []
|
self._gestureBindings[contextName] = []
|
||||||
self._gestureBindings[contextName].append(binding)
|
self._gestureBindings[contextName].append(binding)
|
||||||
|
|
||||||
|
# Register key grab at the system level
|
||||||
|
grab_ids = self.app.addKeyGrab(binding)
|
||||||
|
|
||||||
|
# For later removal
|
||||||
|
if grab_ids:
|
||||||
|
binding._grab_ids = grab_ids
|
||||||
|
|
||||||
return binding
|
return binding
|
||||||
|
|
||||||
return None
|
return None
|
||||||
@ -132,10 +144,17 @@ class APIHelper:
|
|||||||
bindings = cthulhu_state.activeScript.getKeyBindings()
|
bindings = cthulhu_state.activeScript.getKeyBindings()
|
||||||
bindings.remove(binding)
|
bindings.remove(binding)
|
||||||
|
|
||||||
# Remove from our tracking
|
# Remove key grab at system level
|
||||||
|
if hasattr(binding, '_grab_ids'):
|
||||||
|
for grab_id in binding._grab_ids:
|
||||||
|
self.app.removeKeyGrab(grab_id)
|
||||||
|
|
||||||
|
# Remove from tracking
|
||||||
if contextName in self._gestureBindings:
|
if contextName in self._gestureBindings:
|
||||||
if binding in self._gestureBindings[contextName]:
|
if binding in self._gestureBindings[contextName]:
|
||||||
self._gestureBindings[contextName].remove(binding)
|
self._gestureBindings[contextName].remove(binding)
|
||||||
|
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
import importlib
|
import importlib
|
||||||
import os
|
import os
|
||||||
|
@ -23,5 +23,5 @@
|
|||||||
# Fork of Orca Screen Reader (GNOME)
|
# Fork of Orca Screen Reader (GNOME)
|
||||||
# Original source: https://gitlab.gnome.org/GNOME/orca
|
# Original source: https://gitlab.gnome.org/GNOME/orca
|
||||||
|
|
||||||
version = "2025.04.04"
|
version = "2025.04.18"
|
||||||
codeName = "testing"
|
codeName = "testing"
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 Stormux
|
# Copyright (c) 2024 Stormux
|
||||||
# Copyright (c) 2010-2012 The Orca Team
|
|
||||||
# Copyright (c) 2012 Igalia, S.L.
|
|
||||||
# Copyright (c) 2005-2010 Sun Microsystems Inc.
|
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@ -20,8 +17,6 @@
|
|||||||
# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
|
# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
|
||||||
# Boston MA 02110-1301 USA.
|
# Boston MA 02110-1301 USA.
|
||||||
#
|
#
|
||||||
# Fork of Orca Screen Reader (GNOME)
|
|
||||||
# Original source: https://gitlab.gnome.org/GNOME/orca
|
|
||||||
|
|
||||||
"""Self Voice plugin for Cthulhu screen reader."""
|
"""Self Voice plugin for Cthulhu screen reader."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user