[orca/gnome-3-36] Web: Always speak the current line when caret moves due to mouse click



commit 6a457b1560a93acf96ca4715e884277324032adb
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jun 3 11:13:52 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 93b2bb020..e3a5b88ae 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1247,6 +1247,12 @@ class Script(default.Script):
             debug.println(debug.LEVEL_INFO, msg, True)
             contents = self.utilities.getLineContentsAtOffset(newFocus, 0)
             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]