orca r3931 - in trunk: . src/orca/scripts/toolkits/Gecko test/keystrokes/firefox



Author: joanied
Date: Wed May 28 16:51:11 2008
New Revision: 3931
URL: http://svn.gnome.org/viewvc/orca?rev=3931&view=rev

Log:
* src/orca/scripts/toolkits/Gecko/script.py:
  test/keystrokes/firefox/label_guess_bugzilla_search.py:
  Fix for bug #535149 - Orca should override Home and End in 
  Firefox 3 and Thunderbird.



Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/toolkits/Gecko/script.py
   trunk/test/keystrokes/firefox/label_guess_bugzilla_search.py

Modified: trunk/src/orca/scripts/toolkits/Gecko/script.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/script.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/script.py	Wed May 28 16:51:11 2008
@@ -116,7 +116,9 @@
              Script.goPreviousLine,
              Script.expandComboBox,
              Script.goTopOfFile,
-             Script.goBottomOfFile]
+             Script.goBottomOfFile,
+             Script.goBeginningOfLine,
+             Script.goEndOfLine]
 
         # _structuralNavigationFunctions are functions that represent
         # more complex navigation functions (e.g., moving by heading,
@@ -339,6 +341,22 @@
                 #
                 _("Goes to the bottom of the file."))
 
+        self.inputEventHandlers["goBeginningOfLineHandler"] = \
+            input_event.InputEventHandler(
+                Script.goBeginningOfLine,
+                # Translators: this command will move the user to the
+                # beginning of the line in an HTML document.
+                #
+                _("Goes to the beginning of the line."))
+
+        self.inputEventHandlers["goEndOfLineHandler"] = \
+            input_event.InputEventHandler(
+                Script.goEndOfLine,
+                # Translators: this command will move the user to the
+                # end of the line in an HTML document.
+                #
+                _("Goes to the end of the line."))
+
         self.inputEventHandlers["expandComboBoxHandler"] = \
             input_event.InputEventHandler(
                 Script.expandComboBox,
@@ -906,6 +924,20 @@
                 controlModMask,
                 self.inputEventHandlers["goBottomOfFileHandler"]))
 
+        keyBindings.add(
+            keybindings.KeyBinding(
+                "Home",
+                fullModMask,
+                0,
+                self.inputEventHandlers["goBeginningOfLineHandler"]))
+
+        keyBindings.add(
+            keybindings.KeyBinding(
+                "End",
+                fullModMask,
+                0,
+                self.inputEventHandlers["goEndOfLineHandler"]))
+
         return keyBindings
 
     def getKeyBindings(self):
@@ -3357,6 +3389,12 @@
             #
             newLineAdjustment = int(not singleLine)
 
+            # Home and End should not be overridden if we're in an
+            # entry.
+            #
+            if keyboardEvent.event_string in ["Home", "End"]:
+                return False
+
             # We want to use our caret navigation model in an entry if
             # there's nothing in the entry, we're at the beginning of
             # the entry and press Left or Up, or we're at the end of the
@@ -6862,6 +6900,28 @@
         #contents = self.getLineContentsAtOffset(nextObj, nextCharOffset)
         #self.dumpContents(inputEvent, contents)
 
+    def goBeginningOfLine(self, inputEvent):
+        """Positions the caret offset at the beginning of the line."""
+
+        [obj, characterOffset] = self.getCaretContext()
+        line = self.currentLineContents \
+               or self.getLineContentsAtOffset(obj, characterOffset)
+        obj, characterOffset = line[0][0], line[0][1]
+        self.setCaretPosition(obj, characterOffset)
+        self.speakCharacterAtOffset(obj, characterOffset)
+        self.updateBraille(obj)
+
+    def goEndOfLine(self, inputEvent):
+        """Positions the caret offset at the end of the line."""
+
+        [obj, characterOffset] = self.getCaretContext()
+        line = self.currentLineContents \
+               or self.getLineContentsAtOffset(obj, characterOffset)
+        obj, characterOffset = line[-1][0], line[-1][2] - 1
+        self.setCaretPosition(obj, characterOffset)
+        self.speakCharacterAtOffset(obj, characterOffset)
+        self.updateBraille(obj)
+
     def goTopOfFile(self, inputEvent):
         """Positions the caret offset at the beginning of the document."""
 

Modified: trunk/test/keystrokes/firefox/label_guess_bugzilla_search.py
==============================================================================
--- trunk/test/keystrokes/firefox/label_guess_bugzilla_search.py	(original)
+++ trunk/test/keystrokes/firefox/label_guess_bugzilla_search.py	Wed May 28 16:51:11 2008
@@ -30,8 +30,13 @@
                              acc_role=pyatspi.ROLE_DOCUMENT_FRAME))
 
 ########################################################################
-# Press Control+Home to move to the top.
+# Press Orca+Right to get out of the focused entry, then Control+Home
+# to move to the top.
 #
+sequence.append(KeyPressAction(0, None, "KP_Insert"))
+sequence.append(KeyComboAction("Right"))
+sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
+
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("<Control>Home"))
 sequence.append(utils.AssertPresentationAction(



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