[orca] Fix for bug 638883 - Orca should present text which auto-inserted into editable, non-terminal widget



commit b66a22482cb0ef25fd268ef37a6c48f713241b43
Author: Joanmarie <joanmarie diggs gmail com>
Date:   Sun May 8 11:38:02 2011 +0200

    Fix for bug 638883 - Orca should present text which auto-inserted into editable, non-terminal widgets

 src/orca/script_utilities.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 0899589..8d620b7 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2577,6 +2577,20 @@ class Utilities:
         - event: the accessible event being examined
         """
 
+        if event.type.startswith("object:text-changed:insert"):
+            if not event.any_data or not event.source:
+                return False
+
+            state = event.source.getState()
+            if not state.contains(pyatspi.STATE_EDITABLE):
+                return False
+
+            lastKey, mods = self.lastKeyAndModifiers()
+            if lastKey == "Tab" and event.any_data != "\t":
+                return True
+            if lastKey == "Return" and event.any_data != "\n":
+                return True
+
         return False
 
     def isSentenceDelimiter(self, currentChar, previousChar):



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