[orca/gnome-3-38] Web: Don't clear command state when the last keyboard event is modifier
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-38] Web: Don't clear command state when the last keyboard event is modifier
- Date: Wed, 6 Jan 2021 11:04:59 +0000 (UTC)
commit ac7e5c2e3cd1f63f787cceb11f53105561cd8aae
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Jan 6 11:46:36 2021 +0100
Web: Don't clear command state when the last keyboard event is modifier
We were losing track that the last command was a caret-navigation
command when Ctrl was released after using Ctrl+Home. As a result,
when the browser emits caret-moved and focus-changed events we
triggered, we process them rather than ignoring them as caused by us.
src/orca/input_event.py | 6 ++++++
src/orca/scripts/web/script.py | 8 +++++---
2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/input_event.py b/src/orca/input_event.py
index 8211d6ffb..d230b4888 100644
--- a/src/orca/input_event.py
+++ b/src/orca/input_event.py
@@ -869,6 +869,12 @@ class KeyboardEvent(InputEvent):
msg = 'CONSUMED: %s (%s)' % (self._did_consume, self._result_reason)
debug.println(debug.LEVEL_INFO, msg, True)
+ if debug.LEVEL_INFO >= debug.debugLevel and orca_state.activeScript:
+ attributes = orca_state.activeScript.getTransferableAttributes()
+ for key, value in attributes.items():
+ msg = 'INPUT EVENT: %s: %s' % (key, value)
+ debug.println(debug.LEVEL_INFO, msg, True)
+
msg = 'TOTAL PROCESSING TIME: %.4f' % (time.time() - startTime)
debug.println(debug.LEVEL_INFO, msg, True)
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 83afb0594..6ee5b2e7f 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -551,9 +551,11 @@ class Script(default.Script):
self._lastCommandWasMouseButton = False
return consumes
- self._lastCommandWasCaretNav = False
- self._lastCommandWasStructNav = False
- self._lastCommandWasMouseButton = False
+ if not keyboardEvent.isModifierKey():
+ self._lastCommandWasCaretNav = False
+ self._lastCommandWasStructNav = False
+ self._lastCommandWasMouseButton = False
+
return super().consumesKeyboardEvent(keyboardEvent)
def consumesBrailleEvent(self, brailleEvent):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]