[orca] Update the position and command state in Gecko after a mouse click
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Update the position and command state in Gecko after a mouse click
- Date: Wed, 5 Nov 2014 13:05:25 +0000 (UTC)
commit 699bdb90f1a344d22b70f53d91fd0d757d1207ec
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Nov 5 08:03:41 2014 -0500
Update the position and command state in Gecko after a mouse click
src/orca/scripts/toolkits/Gecko/script.py | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index f69f1f1..ff3da14 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -234,6 +234,7 @@ class Script(default.Script):
self._lastCommandWasCaretNav = False
self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = False
# See bug 665522 - comment 5
app.setCacheMask(pyatspi.cache.DEFAULT ^ pyatspi.cache.CHILDREN)
@@ -674,32 +675,38 @@ class Script(default.Script):
consumes = self.useCaretNavigationModel(keyboardEvent)
self._lastCommandWasCaretNav = consumes
self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = False
elif handler \
and (handler.function in self.structuralNavigation.functions \
or handler.function in self._liveRegionFunctions):
consumes = self.useStructuralNavigationModel()
self._lastCommandWasCaretNav = False
self._lastCommandWasStructNav = consumes
+ self._lastCommandWasMouseButton = False
else:
consumes = handler != None
self._lastCommandWasCaretNav = False
self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = False
if not consumes:
handler = self.keyBindings.getInputHandler(keyboardEvent)
if handler and handler.function in self._caretNavigationFunctions:
consumes = self.useCaretNavigationModel(keyboardEvent)
self._lastCommandWasCaretNav = consumes
self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = False
elif handler \
and (handler.function in self.structuralNavigation.functions \
or handler.function in self._liveRegionFunctions):
consumes = self.useStructuralNavigationModel()
self._lastCommandWasCaretNav = False
self._lastCommandWasStructNav = consumes
+ self._lastCommandWasMouseButton = False
else:
consumes = handler != None
self._lastCommandWasCaretNav = False
self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = False
return consumes
def textLines(self, obj):
@@ -874,6 +881,11 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg)
return
+ if self._lastCommandWasMouseButton:
+ orca.setLocusOfFocus(event, event.source)
+ self.setCaretContext(event.source, event.detail1)
+ return
+
text = self.utilities.queryNonEmptyText(event.source)
if not text:
if event.source.getRole() == pyatspi.ROLE_LINK:
@@ -1260,6 +1272,14 @@ class Script(default.Script):
default.Script.onFocusedChanged(self, event)
+ def onMouseButton(self, event):
+ """Callback for mouse:button accessibility events."""
+
+ self._lastCommandWasCaretNav = False
+ self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = True
+ default.Script.onMouseButton(self, event)
+
def onShowingChanged(self, event):
"""Callback for object:state-changed:showing accessibility events."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]