[orca] Allow scripts to determine if we should really synthesize a click on a char
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Allow scripts to determine if we should really synthesize a click on a char
- Date: Wed, 15 May 2019 17:41:20 +0000 (UTC)
commit 41cacc4c6178d2af69af603f4f339ce3aaad356d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed May 15 19:36:43 2019 +0200
Allow scripts to determine if we should really synthesize a click on a char
Some objects officially implement the accessible text interface, but don't
actually have meaningful text. In those cases, we don't want to try to
synthesize a click on a character; instead we should click on the object.
The scripts know what object really have text that should be handled on
a per-character basis so ask them if we have valid characters to click on.
src/orca/scripts/default.py | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 4fbe1581d..5b97aaf95 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -1306,14 +1306,17 @@ class Script(script.Script):
if self.flatReviewContext:
self.flatReviewContext.clickCurrent(1)
- else:
- try:
- eventsynthesizer.clickCharacter(orca_state.locusOfFocus, 1)
- except:
- try:
- eventsynthesizer.clickObject(orca_state.locusOfFocus, 1)
- except:
- self.speakMessage(messages.LOCATION_NOT_FOUND_FULL)
+ return True
+
+ if self.utilities.queryNonEmptyText(orca_state.locusOfFocus):
+ eventsynthesizer.clickCharacter(orca_state.locusOfFocus, 1)
+ return True
+
+ try:
+ eventsynthesizer.clickObject(orca_state.locusOfFocus, 1)
+ except:
+ self.speakMessage(messages.LOCATION_NOT_FOUND_FULL)
+
return True
def rightClickReviewItem(self, inputEvent=None):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]