[orca/gnome-2-28] Still more work on bgo#597159 - Orca does not provide access to the contents of Packagemanager's HTM



commit 21aa80f8e675f381502a9dba51b1c645385d9b61
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun Nov 15 14:09:24 2009 -0500

    Still more work on bgo#597159 - Orca does not provide access to the contents of Packagemanager's HTML container
    
    Speak the correct character when crossing object boundaries.

 src/orca/scripts/apps/packagemanager/script.py |   29 ++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/packagemanager/script.py b/src/orca/scripts/apps/packagemanager/script.py
index 24be5c0..5064b53 100644
--- a/src/orca/scripts/apps/packagemanager/script.py
+++ b/src/orca/scripts/apps/packagemanager/script.py
@@ -275,6 +275,35 @@ class Script(default.Script):
         braille.setFocus(focusedRegion, getLinkMask=False)
         braille.refresh(panToCursor=True, getLinkMask=False)
 
+    def sayCharacter(self, obj):
+        """Speak the character at the caret. Overridden here because the
+        event we get when crossing object boundaries is for the object
+        being left.
+
+        Arguments:
+        - obj: an Accessible object that implements the AccessibleText
+               interface
+        """
+
+        if not self.getAncestor(
+           obj, [pyatspi.ROLE_HTML_CONTAINER], [pyatspi.ROLE_FRAME]):
+            return default.Script.sayCharacter(self, obj)
+
+        try:
+            text = obj.queryText()
+        except:
+            return
+
+        if text.caretOffset == text.characterCount \
+           and isinstance(orca_state.lastInputEvent,
+                          input_event.KeyboardEvent) \
+           and orca_state.lastNonModifierKeyEvent.event_string == "Right":
+            nextObj = self.getRelationTarget(obj, pyatspi.RELATION_FLOWS_TO)
+            if nextObj and nextObj.getRole() == pyatspi.ROLE_TEXT:
+                obj = nextObj
+
+        default.Script.sayCharacter(self, obj)
+
     def sayLine(self, obj):
         """Speaks the line at the current caret position."""
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]