orca r3992 - in trunk: . src/orca



Author: joanied
Date: Wed Jun 18 21:05:06 2008
New Revision: 3992
URL: http://svn.gnome.org/viewvc/orca?rev=3992&view=rev

Log:
* src/orca/orca.py:
  src/orca/default.py:
  src/orca/focus_tracking_presenter.py:
  src/orca/orca_state.py:
  src/orca/orca_gui_prefs.py:
  Fix for bug #536825 - Allow bypass of Orca's keyboard commands.



Modified:
   trunk/ChangeLog
   trunk/src/orca/default.py
   trunk/src/orca/focus_tracking_presenter.py
   trunk/src/orca/orca.py
   trunk/src/orca/orca_gui_prefs.py
   trunk/src/orca/orca_state.py

Modified: trunk/src/orca/default.py
==============================================================================
--- trunk/src/orca/default.py	(original)
+++ trunk/src/orca/default.py	Wed Jun 18 21:05:06 2008
@@ -937,6 +937,18 @@
                 #
                 _("Toggle mouse review mode."))
 
+        self.inputEventHandlers["bypassNextCommandHandler"] = \
+            input_event.InputEventHandler(
+                Script.bypassNextCommand,
+                # Translators: Orca normally intercepts all keyboard
+                # commands and only passes them along to the current
+                # application when they are not Orca commands.  This
+                # command causes the next command issued to be passed
+                # along to the current application, bypassing Orca's
+                # interception of it.
+                #
+                _("Passes the next command on to the current application."))
+
     def getInputEventHandlerKey(self, inputEventHandler):
         """Returns the name of the key that contains an inputEventHadler
         passed as argument
@@ -1782,6 +1794,13 @@
                     settings.SHIFT_ALT_MODIFIER_MASK,
                     self.inputEventHandlers["bookmarkCurrentWhereAmI"]))
 
+        keyBindings.add(
+            keybindings.KeyBinding(
+                "BackSpace",
+                settings.defaultModifierMask,
+                settings.ORCA_MODIFIER_MASK,
+                self.inputEventHandlers["bypassNextCommandHandler"]))
+
         #####################################################################
         #                                                                   #
         #  Unbound handlers                                                 #
@@ -4265,6 +4284,24 @@
 
         return True
 
+    def bypassNextCommand(self, inputEvent=None):
+        """Causes the next keyboard command to be ignored by Orca
+        and passed along to the current application.
+
+        Returns True to indicate the input event has been consumed.
+        """
+
+        # Translators: Orca normally intercepts all keyboard
+        # commands and only passes them along to the current
+        # application when they are not Orca commands.  This
+        # command causes the next command issued to be passed
+        # along to the current application, bypassing Orca's
+        # interception of it.
+        #
+        speech.speak(_("Bypass mode enabled."))
+        orca_state.bypassNextCommand = True
+        return True
+
     def enterLearnMode(self, inputEvent=None):
         """Turns learn mode on.  The user must press the escape key to exit
         learn mode.

Modified: trunk/src/orca/focus_tracking_presenter.py
==============================================================================
--- trunk/src/orca/focus_tracking_presenter.py	(original)
+++ trunk/src/orca/focus_tracking_presenter.py	Wed Jun 18 21:05:06 2008
@@ -923,12 +923,14 @@
         Returns True if the event should be consumed.
         """
 
+        consume = False
         if orca_state.activeScript \
            and orca_state.activeScript.consumesKeyboardEvent(keyboardEvent):
-            self._enqueueEvent(keyboardEvent)
-            return True
-        else:
-            return False
+            consume = not orca_state.bypassNextCommand
+            if consume:
+                self._enqueueEvent(keyboardEvent)
+
+        return consume
 
     def processBrailleEvent(self, brailleEvent):
         """Called whenever a cursor key is pressed on the Braille display.

Modified: trunk/src/orca/orca.py
==============================================================================
--- trunk/src/orca/orca.py	(original)
+++ trunk/src/orca/orca.py	Wed Jun 18 21:05:06 2008
@@ -796,6 +796,11 @@
                     exitLearnMode(keyboardEvent)
 
                 consumed = True
+
+            if not consumed \
+               and not isModifierKey(keyboardEvent.event_string) \
+               and keyboardEvent.type == pyatspi.KEY_PRESSED_EVENT:
+                orca_state.bypassNextCommand = False
     except:
         debug.printException(debug.LEVEL_SEVERE)
 

Modified: trunk/src/orca/orca_gui_prefs.py
==============================================================================
--- trunk/src/orca/orca_gui_prefs.py	(original)
+++ trunk/src/orca/orca_gui_prefs.py	Wed Jun 18 21:05:06 2008
@@ -3468,7 +3468,8 @@
             return False
 
         keyName = captured.event_string
-        if keyName in ["Delete", "BackSpace"]:
+        isOrcaModifier = captured.modifiers & settings.ORCA_MODIFIER_MASK
+        if keyName in ["Delete", "BackSpace"] and not isOrcaModifier:
             editable.set_text("")
             # Translators: this is a spoken prompt letting the user know
             # Orca has deleted an existing key combination based upon

Modified: trunk/src/orca/orca_state.py
==============================================================================
--- trunk/src/orca/orca_state.py	(original)
+++ trunk/src/orca/orca_state.py	Wed Jun 18 21:05:06 2008
@@ -65,6 +65,11 @@
 #
 lastInputEvent = None
 
+# Used to determine if the user wishes Orca to pass the next command
+# along to the current application rather than consuming it.
+#
+bypassNextCommand = False
+
 # The last timestamp from a device event. Used to set focus for the Orca
 # configuration GUI.
 #



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]