Temperarily change the keyboard short fo version to cthulhu+x.

This commit is contained in:
Storm Dragon 2024-12-19 09:30:59 -05:00
parent 8e9ea3af5a
commit 5dd872535d

View File

@ -35,14 +35,27 @@ class DisplayVersion(GObject.Object, Peas.Activatable, plugin.Plugin):
__gtype_name__ = 'displayversion' __gtype_name__ = 'displayversion'
object = GObject.Property(type=GObject.Object) object = GObject.Property(type=GObject.Object)
def __init__(self): def __init__(self):
plugin.Plugin.__init__(self) plugin.Plugin.__init__(self)
self._api = None
def do_activate(self): def do_activate(self):
API = self.object self._api = self.object
self.registerGestureByString(self.speakText, _(f'Cthulhu screen reader version {cthulhuVersion.version}-{cthulhuVersion.codeName}'), 'kb:cthulhu+shift+v') self.registerGestureByString(
self.speakText,
_(f'Cthulhu screen reader version {cthulhuVersion.version}-{cthulhuVersion.codeName}'),
'kb:cthulhu+x'
)
def do_deactivate(self): def do_deactivate(self):
API = self.object self._api = None
def speakText(self, script=None, inputEvent=None): def speakText(self, script=None, inputEvent=None):
API = self.object if not self._api:
API.app.getDynamicApiManager().getAPI('CthulhuState').activeScript.presentMessage(f'Cthulhu screen reader version {cthulhuVersion.version}-{cthulhuVersion.codeName}', resetStyles=False) return False
self._api.app.getDynamicApiManager().getAPI('CthulhuState').activeScript.presentMessage(
f'Cthulhu screen reader version {cthulhuVersion.version}-{cthulhuVersion.codeName}',
resetStyles=False
)
return True return True