[orca] Add support for aria-keyshortcuts
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Add support for aria-keyshortcuts
- Date: Thu, 3 Aug 2017 10:33:20 +0000 (UTC)
commit d69423c87e1f4b00ba83952dd9fd6276af3920fc
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Aug 3 06:32:56 2017 -0400
Add support for aria-keyshortcuts
src/orca/scripts/web/script_utilities.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 803a110..cb01369 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1611,6 +1611,19 @@ class Utilities(script_utilities.Utilities):
return roles
+ def mnemonicShortcutAccelerator(self, obj):
+ if not (obj and self.inDocumentContent(obj)):
+ return super().mnemonicShortcutAccelerator(obj)
+
+ try:
+ attrs = dict([attr.split(":", 1) for attr in obj.getAttributes()])
+ except:
+ return ["", "", ""]
+
+ keys = map(lambda x: x.replace("+", " "), attrs.get("keyshortcuts", "").split(" "))
+ keys = map(lambda x: x.replace(" ", "+"), map(self.labelFromKeySequence, keys))
+ return ["", " ".join(keys), ""]
+
def unrelatedLabels(self, root, onlyShowing=True):
if not (root and self.inDocumentContent(root)):
return super().unrelatedLabels(root, onlyShowing)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]