orca r3858 - in branches/gnome-2-22: . src/orca
- From: richb svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r3858 - in branches/gnome-2-22: . src/orca
- Date: Mon, 28 Apr 2008 21:23:06 +0100 (BST)
Author: richb
Date: Mon Apr 28 20:23:05 2008
New Revision: 3858
URL: http://svn.gnome.org/viewvc/orca?rev=3858&view=rev
Log:
* src/orca/default.py:
src/orca/orca.py:
Fixed bug #528507 - Escape doesn't exit "learn mode" if the
active script changes.
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/src/orca/default.py
branches/gnome-2-22/src/orca/orca.py
Modified: branches/gnome-2-22/src/orca/default.py
==============================================================================
--- branches/gnome-2-22/src/orca/default.py (original)
+++ branches/gnome-2-22/src/orca/default.py Mon Apr 28 20:23:05 2008
@@ -675,18 +675,6 @@
#
_("Enters learn mode. Press escape to exit learn mode."))
- self.inputEventHandlers["exitLearnModeHandler"] = \
- input_event.InputEventHandler(
- Script.exitLearnMode,
- # Translators: Orca has a "Learn Mode" that will allow
- # the user to type any key on the keyboard and hear what
- # the effects of that key would be. The effects might
- # be what Orca would do if it had a handler for the
- # particular key combination, or they might just be to
- # echo the name of the key if Orca doesn't have a handler.
- #
- _("Exits learn mode."))
-
self.inputEventHandlers["decreaseSpeechRateHandler"] = \
input_event.InputEventHandler(
speech.decreaseSpeechRate,
@@ -1905,10 +1893,6 @@
- keyboardEvent: an instance of input_event.KeyboardEvent
"""
- if (keyboardEvent.type == pyatspi.KEY_PRESSED_EVENT) and \
- (keyboardEvent.event_string == "Escape"):
- settings.learnModeEnabled = False
-
return script.Script.processKeyboardEvent(self, keyboardEvent)
def __sayAllProgressCallback(self, context, progressType):
@@ -3995,13 +3979,6 @@
if settings.learnModeEnabled:
return True
- self.exitLearnModeKeyBinding = keybindings.KeyBinding(
- "Escape",
- 0,
- 0,
- self.inputEventHandlers["exitLearnModeHandler"])
- self.keyBindings.add(self.exitLearnModeKeyBinding)
-
speech.speak(
# Translators: Orca has a "Learn Mode" that will allow
# the user to type any key on the keyboard and hear what
@@ -4027,28 +4004,6 @@
settings.learnModeEnabled = True
return True
- def exitLearnMode(self, inputEvent=None):
- """Turns learn mode off.
-
- Returns True to indicate the input event has been consumed.
- """
-
- self.keyBindings.remove(self.exitLearnModeKeyBinding)
-
- # Translators: Orca has a "Learn Mode" that will allow
- # the user to type any key on the keyboard and hear what
- # the effects of that key would be. The effects might
- # be what Orca would do if it had a handler for the
- # particular key combination, or they might just be to
- # echo the name of the key if Orca doesn't have a handler.
- # Exiting learn mode puts the user back in normal operating
- # mode.
- #
- message = _("Exiting learn mode.")
- speech.speak(message)
- braille.displayMessage(message)
- return True
-
def pursueForFlatReview(self, obj):
"""Determines if we should look any further at the object
for flat review."""
Modified: branches/gnome-2-22/src/orca/orca.py
==============================================================================
--- branches/gnome-2-22/src/orca/orca.py (original)
+++ branches/gnome-2-22/src/orca/orca.py Mon Apr 28 20:23:05 2008
@@ -297,6 +297,27 @@
return True
+def exitLearnMode(self, inputEvent=None):
+ """Turns learn mode off.
+
+ Returns True to indicate the input event has been consumed.
+ """
+
+ # Translators: Orca has a "Learn Mode" that will allow
+ # the user to type any key on the keyboard and hear what
+ # the effects of that key would be. The effects might
+ # be what Orca would do if it had a handler for the
+ # particular key combination, or they might just be to
+ # echo the name of the key if Orca doesn't have a handler.
+ # Exiting learn mode puts the user back in normal operating
+ # mode.
+ #
+ message = _("Exiting learn mode.")
+ speech.speak(message)
+ braille.displayMessage(message)
+ settings.learnModeEnabled = False
+ return True
+
########################################################################
# #
# METHODS FOR PRE-PROCESSING AND MASSAGING KEYBOARD EVENTS. #
@@ -739,6 +760,10 @@
event_string = keyboardEvent.event_string
event_string = keynames.getKeyName(event_string)
speech.speak(event_string)
+ elif (event.type == pyatspi.KEY_RELEASED_EVENT) and \
+ (keyboardEvent.event_string == "Escape"):
+ exitLearnMode(keyboardEvent)
+
consumed = True
except:
debug.printException(debug.LEVEL_SEVERE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]