[orca] Fix for bgo#618381 - Remove verbose keybinding code from default.py.
- From: Mesar Hameed <mhameed src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for bgo#618381 - Remove verbose keybinding code from default.py.
- Date: Wed, 12 May 2010 12:06:43 +0000 (UTC)
commit 49c7a5faad85c07b7bf368e3a2280ef169c3454b
Author: Mesar Hameed <mhameed src gnome org>
Date: Wed May 12 13:05:18 2010 +0100
Fix for bgo#618381 - Remove verbose keybinding code from default.py.
src/orca/Makefile.am | 3 +
src/orca/common_keyboardmap.py | 207 +++++++++
src/orca/default.py | 926 +--------------------------------------
src/orca/desktop_keyboardmap.py | 209 +++++++++
src/orca/keybindings.py | 29 ++
src/orca/laptop_keyboardmap.py | 144 ++++++
6 files changed, 598 insertions(+), 920 deletions(-)
---
diff --git a/src/orca/Makefile.am b/src/orca/Makefile.am
index 3680632..931d57c 100644
--- a/src/orca/Makefile.am
+++ b/src/orca/Makefile.am
@@ -17,10 +17,12 @@ orca_python_PYTHON = \
brlmon.py \
chat.py \
chnames.py \
+ common_keyboardmap.py \
dbusserver.py \
debug.py \
dectalk.py \
default.py \
+ desktop_keyboardmap.py \
espeechfactory.py \
eventsynthesizer.py \
find.py \
@@ -34,6 +36,7 @@ orca_python_PYTHON = \
input_event.py \
keybindings.py \
keynames.py \
+ laptop_keyboardmap.py \
liveregions.py \
mag.py \
mouse_review.py \
diff --git a/src/orca/common_keyboardmap.py b/src/orca/common_keyboardmap.py
new file mode 100644
index 0000000..cb4af0d
--- /dev/null
+++ b/src/orca/common_keyboardmap.py
@@ -0,0 +1,207 @@
+# Orca
+#
+# Copyright 2010 Joanmarie Diggs, Mesar Hameed.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+""" A list of common keybindings and unbound keys
+ pulled out from default.py: getKeyBindings()
+ with the goal of being more readable and less monolithic.
+"""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2010 Joanmarie Diggs, Mesar Hameed."
+__license__ = "LGPL"
+
+import settings
+
+# Storing values
+defaultModifierMask = settings.defaultModifierMask
+ORCA_MODIFIER_MASK = settings.ORCA_MODIFIER_MASK
+NO_MODIFIER_MASK = settings.NO_MODIFIER_MASK
+ORCA_SHIFT_MODIFIER_MASK = settings.ORCA_SHIFT_MODIFIER_MASK
+ORCA_CTRL_MODIFIER_MASK = settings.ORCA_CTRL_MODIFIER_MASK
+ORCA_ALT_MODIFIER_MASK = settings.ORCA_ALT_MODIFIER_MASK
+ORCA_CTRL_ALT_MODIFIER_MASK = settings.ORCA_CTRL_ALT_MODIFIER_MASK
+SHIFT_ALT_MODIFIER_MASK = settings.SHIFT_ALT_MODIFIER_MASK
+
+keymap = (
+ ("Num_Lock", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "showZonesHandler"),
+
+ ("F11", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "toggleTableCellReadModeHandler"),
+
+ ("SunF36", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "toggleTableCellReadModeHandler"),
+
+ ("f", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "readCharAttributesHandler"),
+
+ ("h", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "enterLearnModeHandler"),
+
+ ("q", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "shutdownHandler"),
+
+ ("space", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "preferencesSettingsHandler"),
+
+ ("space", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "appPreferencesSettingsHandler"),
+
+ ("s", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "toggleSilenceSpeechHandler"),
+
+ ("End", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
+ "listAppsHandler"),
+ ("Home", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
+ "reportScriptInfoHandler"),
+
+
+ ("Page_Up", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
+ "printAncestryHandler"),
+
+ ("Page_Down", defaultModifierMask, ORCA_CTRL_ALT_MODIFIER_MASK,
+ "printHierarchyHandler"),
+
+ #####################################################################
+ # #
+ # Bookmark key bindings #
+ # #
+ #####################################################################
+
+ # key binding to save bookmark information to disk
+ ("b", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "saveBookmarks"),
+
+ # key binding to move to the previous bookmark
+ ("b", defaultModifierMask, ORCA_SHIFT_MODIFIER_MASK,
+ "goToPrevBookmark"),
+
+ # key binding to move to the next bookmark
+ ("b", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToNextBookmark"),
+
+ # key bindings for '1' through '6' for relevant commands
+
+ # 'Add bookmark' key bindings
+ ("1", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"),
+ ("2", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"),
+ ("3", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"),
+ ("4", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"),
+ ("5", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"),
+ ("6", defaultModifierMask, ORCA_ALT_MODIFIER_MASK,
+ "addBookmark"),
+
+ # 'Go to bookmark' key bindings
+
+ ("1", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToBookmark"),
+ ("2", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToBookmark"),
+ ("3", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToBookmark"),
+ ("4", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToBookmark"),
+ ("5", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToBookmark"),
+ ("6", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "goToBookmark"),
+
+ # key binding for WhereAmI information with respect to root acc
+
+ ("1", defaultModifierMask, SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"),
+ ("2", defaultModifierMask, SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"),
+ ("3", defaultModifierMask, SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"),
+ ("4", defaultModifierMask, SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"),
+ ("5", defaultModifierMask, SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"),
+ ("6", defaultModifierMask, SHIFT_ALT_MODIFIER_MASK,
+ "bookmarkCurrentWhereAmI"),
+
+
+ ("BackSpace", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "bypassNextCommandHandler"),
+
+
+ #####################################################################
+ # #
+ # Unbound handlers #
+ # #
+ #####################################################################
+
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "cycleDebugLevelHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "decreaseSpeechRateHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "increaseSpeechRateHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "decreaseSpeechPitchHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "increaseSpeechPitchHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "toggleColorEnhancementsHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "toggleMouseEnhancementsHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "increaseMagnificationHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "decreaseMagnificationHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "toggleMagnifierHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "cycleZoomerTypeHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "panBrailleLeftHandler"),
+
+ ("",defaultModifierMask, NO_MODIFIER_MASK,
+ "panBrailleRightHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "toggleMouseReviewHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "toggleSpeakingIndentationJustificationHandler"),
+
+ ("", defaultModifierMask, NO_MODIFIER_MASK,
+ "cycleSpeakingPunctuationLevelHandler"),
+
+)
diff --git a/src/orca/default.py b/src/orca/default.py
index eb71c7c..7ad6fae 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -1117,415 +1117,9 @@ class Script(script.Script):
numeric keypad for focus tracking and flat review.
"""
+ import desktop_keyboardmap
keyBindings = keybindings.KeyBindings()
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Divide",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["routePointerToItemHandler"]))
-
- # We want the user to be able to combine modifiers with the
- # mouse click (e.g. to Shift+Click and select), therefore we
- # do not "care" about the modifiers -- unless it's the Orca
- # modifier.
- #
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Divide",
- settings.ORCA_MODIFIER_MASK,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["leftClickReviewItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Multiply",
- settings.ORCA_MODIFIER_MASK,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["rightClickReviewItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Subtract",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["toggleFlatReviewModeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Add",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["sayAllHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Enter",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["whereAmIBasicHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Enter",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["whereAmIDetailedHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Enter",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["getTitleHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Enter",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["getStatusBarHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Delete",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["findHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Delete",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["findNextHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Delete",
- settings.defaultModifierMask,
- settings.ORCA_SHIFT_MODIFIER_MASK,
- self.inputEventHandlers["findPreviousHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_7",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Home",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_7",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewHomeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Home",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewHomeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_8",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentLineHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_8",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentLineHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_8",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPhoneticCurrentLineHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Up",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentLineHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Up",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentLineHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Up",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPhoneticCurrentLineHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_9",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Page_Up",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_9",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewEndHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Page_Up",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewEndHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_4",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Left",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_4",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewAboveHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Left",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewAboveHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_5",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentItemHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_5",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentItemHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_5",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPhoneticCurrentItemHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Begin",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentItemHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Begin",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentItemHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Begin",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPhoneticCurrentItemHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_5",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentAccessibleHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Begin",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentAccessibleHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_6",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Right",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_6",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewBelowHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Right",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewBelowHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_1",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousCharacterHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_End",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousCharacterHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_1",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewEndOfLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_End",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewEndOfLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_2",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentCharacterHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_2",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentCharacterHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_2",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewUnicodeCurrentCharacterHandler"],
- 3))
-
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Down",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentCharacterHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Down",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentCharacterHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Down",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers[
- "reviewUnicodeCurrentCharacterHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_3",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextCharacterHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "KP_Page_Down",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextCharacterHandler"]))
-
+ keyBindings.load(desktop_keyboardmap.keymap, self.inputEventHandlers)
return keyBindings
def __getLaptopBindings(self):
@@ -1533,249 +1127,9 @@ class Script(script.Script):
the main keyboard keys for focus tracking and flat review.
"""
+ import laptop_keyboardmap
keyBindings = keybindings.KeyBindings()
-
- keyBindings.add(
- keybindings.KeyBinding(
- "9",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["routePointerToItemHandler"]))
-
- # We want the user to be able to combine modifiers with the
- # mouse click (e.g. to Shift+Click and select), therefore we
- # do not "care" about the modifiers (other than the Orca
- # modifier).
- #
- keyBindings.add(
- keybindings.KeyBinding(
- "7",
- settings.ORCA_MODIFIER_MASK,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["leftClickReviewItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "8",
- settings.ORCA_MODIFIER_MASK,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["rightClickReviewItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "p",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["toggleFlatReviewModeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "semicolon",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["sayAllHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "Return",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["whereAmIBasicHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "Return",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["whereAmIDetailedHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "slash",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["getTitleHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "slash",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["getStatusBarHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "bracketleft",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["findHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "bracketright",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["findNextHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "bracketright",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["findPreviousHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "u",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "u",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["reviewHomeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "i",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentLineHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "i",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentLineHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "i",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewPhoneticCurrentLineHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "o",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "o",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["reviewEndHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "j",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "j",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["reviewAboveHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "k",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentItemHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "k",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentItemHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "k",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewPhoneticCurrentItemHandler"],
- 3))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "k",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentAccessibleHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "l",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextItemHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "l",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["reviewBelowHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "m",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewPreviousCharacterHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "m",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["reviewEndOfLineHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "comma",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewCurrentCharacterHandler"],
- 1))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "comma",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewSpellCurrentCharacterHandler"],
- 2))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "period",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["reviewNextCharacterHandler"]))
-
+ keyBindings.load(laptop_keyboardmap.keymap, self.inputEventHandlers)
return keyBindings
def getKeyBindings(self):
@@ -1793,169 +1147,8 @@ class Script(script.Script):
for keyBinding in self.__getLaptopBindings().keyBindings:
keyBindings.add(keyBinding)
- keyBindings.add(
- keybindings.KeyBinding(
- "Num_Lock",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["showZonesHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "F11",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["toggleTableCellReadModeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "SunF36",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["toggleTableCellReadModeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "f",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["readCharAttributesHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "h",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["enterLearnModeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "q",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["shutdownHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "space",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["preferencesSettingsHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "space",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_MODIFIER_MASK,
- self.inputEventHandlers["appPreferencesSettingsHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "s",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["toggleSilenceSpeechHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "End",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_ALT_MODIFIER_MASK,
- self.inputEventHandlers["listAppsHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "Home",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_ALT_MODIFIER_MASK,
- self.inputEventHandlers["reportScriptInfoHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "Page_Up",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_ALT_MODIFIER_MASK,
- self.inputEventHandlers["printAncestryHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "Page_Down",
- settings.defaultModifierMask,
- settings.ORCA_CTRL_ALT_MODIFIER_MASK,
- self.inputEventHandlers["printHierarchyHandler"]))
-
- #####################################################################
- # #
- # Bookmark key bindings #
- # #
- #####################################################################
- # key binding to save bookmark information to disk
- keyBindings.add(
- keybindings.KeyBinding(
- "b",
- settings.defaultModifierMask,
- settings.ORCA_ALT_MODIFIER_MASK,
- self.inputEventHandlers["saveBookmarks"]))
- # key binding to move to the previous bookmark
- keyBindings.add(
- keybindings.KeyBinding(
- "b",
- settings.defaultModifierMask,
- settings.ORCA_SHIFT_MODIFIER_MASK,
- self.inputEventHandlers["goToPrevBookmark"]))
- # key binding to move to the next bookmark
- keyBindings.add(
- keybindings.KeyBinding(
- "b",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["goToNextBookmark"]))
-
- # key bindings for '1' through '6' for relevant commands
- for key in xrange(1, 7):
- # 'Add bookmark' key bindings
- keyBindings.add(
- keybindings.KeyBinding(
- str(key),
- settings.defaultModifierMask,
- settings.ORCA_ALT_MODIFIER_MASK,
- self.inputEventHandlers["addBookmark"]))
-
- # 'Go to bookmark' key bindings
- keyBindings.add(
- keybindings.KeyBinding(
- str(key),
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["goToBookmark"]))
-
- # key binding for WhereAmI information with respect to root acc
- keyBindings.add(
- keybindings.KeyBinding(
- str(key),
- settings.defaultModifierMask,
- settings.SHIFT_ALT_MODIFIER_MASK,
- self.inputEventHandlers["bookmarkCurrentWhereAmI"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "BackSpace",
- settings.defaultModifierMask,
- settings.ORCA_MODIFIER_MASK,
- self.inputEventHandlers["bypassNextCommandHandler"]))
-
- #####################################################################
- # #
- # Unbound handlers #
- # #
- #####################################################################
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["cycleDebugLevelHandler"]))
+ import common_keyboardmap
+ keyBindings.load(common_keyboardmap.keymap, self.inputEventHandlers)
if settings.debugMemoryUsage:
keyBindings.add(
@@ -1965,113 +1158,6 @@ class Script(script.Script):
settings.NO_MODIFIER_MASK,
self.inputEventHandlers["printMemoryUsageHandler"]))
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["decreaseSpeechRateHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["increaseSpeechRateHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["decreaseSpeechPitchHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["increaseSpeechPitchHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["toggleColorEnhancementsHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["toggleMouseEnhancementsHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["increaseMagnificationHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["decreaseMagnificationHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["toggleMagnifierHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["cycleZoomerTypeHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["panBrailleLeftHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["panBrailleRightHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers["toggleMouseReviewHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers[ \
- "toggleSpeakingIndentationJustificationHandler"]))
-
- keyBindings.add(
- keybindings.KeyBinding(
- "",
- settings.defaultModifierMask,
- settings.NO_MODIFIER_MASK,
- self.inputEventHandlers[ \
- "cycleSpeakingPunctuationLevelHandler"]))
-
try:
keyBindings = settings.overrideKeyBindings(self, keyBindings)
except:
diff --git a/src/orca/desktop_keyboardmap.py b/src/orca/desktop_keyboardmap.py
new file mode 100644
index 0000000..5d0a335
--- /dev/null
+++ b/src/orca/desktop_keyboardmap.py
@@ -0,0 +1,209 @@
+# Orca
+#
+# Copyright 2010 Joanmarie Diggs, Mesar Hameed.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+""" A list of common keybindings and unbound keys
+ pulled out from default.py: __getDesktopBindings()
+ with the goal of being more readable and less monolithic.
+"""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2010 Joanmarie Diggs, Mesar Hameed."
+__license__ = "LGPL"
+
+import settings
+
+# Storing values
+defaultModifierMask = settings.defaultModifierMask
+ORCA_MODIFIER_MASK = settings.ORCA_MODIFIER_MASK
+NO_MODIFIER_MASK = settings.NO_MODIFIER_MASK
+ORCA_SHIFT_MODIFIER_MASK = settings.ORCA_SHIFT_MODIFIER_MASK
+
+keymap = (
+
+ ("KP_Divide", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "routePointerToItemHandler"),
+
+ # We want the user to be able to combine modifiers with the
+ # mouse click (e.g. to Shift+Click and select), therefore we
+ # do not "care" about the modifiers -- unless it's the Orca
+ # modifier.
+ #
+ ("KP_Divide", ORCA_MODIFIER_MASK, NO_MODIFIER_MASK,
+ "leftClickReviewItemHandler"),
+
+ ("KP_Multiply", ORCA_MODIFIER_MASK, NO_MODIFIER_MASK,
+ "rightClickReviewItemHandler"),
+
+ ("KP_Subtract", defaultModifierMask, NO_MODIFIER_MASK,
+ "toggleFlatReviewModeHandler"),
+
+ ("KP_Add", defaultModifierMask, NO_MODIFIER_MASK,
+ "sayAllHandler"),
+
+ ("KP_Enter", defaultModifierMask, NO_MODIFIER_MASK,
+ "whereAmIBasicHandler", 1),
+
+ ("KP_Enter", defaultModifierMask, NO_MODIFIER_MASK,
+ "whereAmIDetailedHandler", 2),
+
+ ("KP_Enter", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "getTitleHandler", 1),
+
+ ("KP_Enter", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "getStatusBarHandler", 2),
+
+ ("KP_Delete", defaultModifierMask, NO_MODIFIER_MASK,
+ "findHandler"),
+
+ ("KP_Delete", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "findNextHandler"),
+
+ ("KP_Delete", defaultModifierMask, ORCA_SHIFT_MODIFIER_MASK,
+ "findPreviousHandler"),
+
+ ("KP_7", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPreviousLineHandler"),
+
+ ("KP_Home", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPreviousLineHandler"),
+
+ ("KP_7", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ ("KP_Home", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ ("KP_8", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewCurrentLineHandler", 1),
+
+ ("KP_8", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewSpellCurrentLineHandler", 2),
+
+ ("KP_8", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentLineHandler", 3),
+
+ ("KP_Up", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewCurrentLineHandler", 1),
+
+ ("KP_Up", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewSpellCurrentLineHandler", 2),
+
+ ("KP_Up", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentLineHandler", 3),
+
+ ("KP_9", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewNextLineHandler"),
+
+ ("KP_Page_Up", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewNextLineHandler"),
+
+ ("KP_9", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewEndHandler"),
+
+ ("KP_Page_Up", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewEndHandler"),
+
+ ("KP_4", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPreviousItemHandler"),
+
+ ("KP_Left", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPreviousItemHandler"),
+
+ ("KP_4", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ ("KP_Left", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ ("KP_5", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewCurrentItemHandler", 1),
+
+ ("KP_5", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewSpellCurrentItemHandler", 2),
+
+ ("KP_5", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentItemHandler", 3),
+
+ ("KP_Begin", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewCurrentItemHandler", 1),
+
+ ("KP_Begin", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewSpellCurrentItemHandler", 2),
+
+ ("KP_Begin", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPhoneticCurrentItemHandler", 3),
+
+ ("KP_5", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewCurrentAccessibleHandler"),
+
+ ("KP_Begin", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewCurrentAccessibleHandler"),
+
+ ("KP_6", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewNextItemHandler"),
+
+ ("KP_Right", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewNextItemHandler"),
+
+ ("KP_6", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ ("KP_Right", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ ("KP_1", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPreviousCharacterHandler"),
+
+ ("KP_End", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewPreviousCharacterHandler"),
+
+ ("KP_1", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewEndOfLineHandler"),
+
+ ("KP_End", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewEndOfLineHandler"),
+
+ ("KP_2", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewCurrentCharacterHandler", 1),
+
+ ("KP_2", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewSpellCurrentCharacterHandler", 2),
+
+ ("KP_2", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewUnicodeCurrentCharacterHandler", 3),
+
+ ("KP_Down", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewCurrentCharacterHandler", 1),
+
+ ("KP_Down", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewSpellCurrentCharacterHandler", 2),
+
+ ("KP_Down", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewUnicodeCurrentCharacterHandler", 3),
+
+ ("KP_3", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewNextCharacterHandler"),
+
+ ("KP_Page_Down", defaultModifierMask, NO_MODIFIER_MASK,
+ "reviewNextCharacterHandler"),
+
+)
+
diff --git a/src/orca/keybindings.py b/src/orca/keybindings.py
index cebdd2c..90dd27b 100644
--- a/src/orca/keybindings.py
+++ b/src/orca/keybindings.py
@@ -388,6 +388,35 @@ class KeyBindings:
return consumed
+ def load(self, keymap, handlers):
+ """ Takes the keymappings and tries to find a matching named
+ function in handlers.
+ keymap is a list of lists, each list contains 5 elements
+ If addUnbound is set to true, then at the end of loading all the
+ keybindings, any remaining functions will be unbound.
+ """
+
+
+ for i in keymap:
+ keysymstring = i[0]
+ modifierMask = i[1]
+ modifiers = i[2]
+ handler = i[3]
+ try:
+ clickCount = i[4]
+ except:
+ clickCount = 1
+
+ if handlers.has_key(handler):
+ # add the keybinding
+ self.add(KeyBinding( \
+ keysymstring, modifierMask, modifiers, \
+ handlers[handler], clickCount))
+ else:
+ debug.println(debug.LEVEL_WARNING, \
+ "WARNING: could not find %s handler to associate " \
+ "with keybinding." % handler)
+
def validate(self):
"""Tries to find keybindings where the keysym is not set for the
keyboard layout or where multiple keybindings map to the same
diff --git a/src/orca/laptop_keyboardmap.py b/src/orca/laptop_keyboardmap.py
new file mode 100644
index 0000000..14b62a5
--- /dev/null
+++ b/src/orca/laptop_keyboardmap.py
@@ -0,0 +1,144 @@
+# Orca
+#
+# Copyright 2010 Joanmarie Diggs, Mesar Hameed.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+""" A list of common keybindings and unbound keys
+ pulled out from default.py: __getLaptopBindings()
+ with the goal of being more readable and less monolithic.
+"""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2010 Joanmarie Diggs, Mesar Hameed."
+__license__ = "LGPL"
+
+import settings
+
+# Storing values
+defaultModifierMask = settings.defaultModifierMask
+ORCA_MODIFIER_MASK = settings.ORCA_MODIFIER_MASK
+NO_MODIFIER_MASK = settings.NO_MODIFIER_MASK
+ORCA_SHIFT_MODIFIER_MASK = settings.ORCA_SHIFT_MODIFIER_MASK
+ORCA_CTRL_MODIFIER_MASK = settings.ORCA_CTRL_MODIFIER_MASK
+
+keymap = (
+
+ ("9", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "routePointerToItemHandler"),
+
+ # We want the user to be able to combine modifiers with the
+ # mouse click (e.g. to Shift+Click and select), therefore we
+ # do not "care" about the modifiers (other than the Orca
+ # modifier).
+ #
+
+ ("7", ORCA_MODIFIER_MASK, ORCA_MODIFIER_MASK,
+ "leftClickReviewItemHandler"),
+
+ ("8", ORCA_MODIFIER_MASK, ORCA_MODIFIER_MASK,
+ "rightClickReviewItemHandler"),
+
+ ("p", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "toggleFlatReviewModeHandler"),
+
+ ("semicolon", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "sayAllHandler"),
+
+ ("Return", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "whereAmIBasicHandler",1),
+
+ ("Return", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "whereAmIDetailedHandler",2),
+
+ ("slash", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "getTitleHandler",1),
+
+ ("slash", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "getStatusBarHandler",2),
+
+ ("bracketleft", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "findHandler"),
+
+ ("bracketright", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "findNextHandler"),
+
+ ("bracketright", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "findPreviousHandler"),
+
+ ("u", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewPreviousLineHandler"),
+
+ ("u", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "reviewHomeHandler"),
+
+ ("i", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewCurrentLineHandler",1),
+
+ ("i", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewSpellCurrentLineHandler",2),
+
+ ("i", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewPhoneticCurrentLineHandler",3),
+
+ ("o", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewNextLineHandler"),
+
+ ("o", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "reviewEndHandler"),
+
+ ("j", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewPreviousItemHandler"),
+
+ ("j", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "reviewAboveHandler"),
+
+ ("k", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewCurrentItemHandler",1),
+
+ ("k", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewSpellCurrentItemHandler",2),
+
+ ("k", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewPhoneticCurrentItemHandler",3),
+
+ ("k", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "reviewCurrentAccessibleHandler"),
+
+ ("l", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewNextItemHandler"),
+
+ ("l", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "reviewBelowHandler"),
+
+ ("m", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewPreviousCharacterHandler"),
+
+ ("m", defaultModifierMask, ORCA_CTRL_MODIFIER_MASK,
+ "reviewEndOfLineHandler"),
+
+ ("comma", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewCurrentCharacterHandler",1),
+
+ ("comma", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewSpellCurrentCharacterHandler",2),
+
+ ("period", defaultModifierMask, ORCA_MODIFIER_MASK,
+ "reviewNextCharacterHandler"),
+
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]