[orca] Web: Always speak the current line when caret moves due to mouse click



commit 2c3cb885c744e3222a48d8d0b4d29610d62a777c
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jun 3 10:45:42 2020 -0400

    Web: Always speak the current line when caret moves due to mouse click
    
    If the user clicks within some text, presentation was varying depending
    on the type of element and where the caret moved. Always speaking the
    current line is more consistent and more reliable.

 src/orca/scripts/web/script.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 72672e4d8..b7dc65a85 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1293,6 +1293,12 @@ class Script(default.Script):
             debug.println(debug.LEVEL_INFO, msg, True)
             contents = self.utilities.getLineContentsAtOffset(newFocus, caretOffset)
             utterances = self.speechGenerator.generateContents(contents)
+        elif self._lastCommandWasMouseButton and event \
+             and event.type.startswith("object:text-caret-moved"):
+            msg = "WEB: Last input event was mouse button. Generating line contents."
+            debug.println(debug.LEVEL_INFO, msg, True)
+            contents = self.utilities.getLineContentsAtOffset(newFocus, caretOffset)
+            utterances = self.speechGenerator.generateContents(contents)
         else:
             msg = "WEB: New focus %s is not a special case. Generating speech." % newFocus
             debug.println(debug.LEVEL_INFO, msg, True)


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