[orca] Web: Don't clear command state when the last keyboard event is modifier



commit a3be0c09cdc5fc2ff6a52739fb7f5e2b6f8c20b2
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 35aa95148..e0bf95cf8 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -563,9 +563,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]