[orca] Fix for bug 665804 - Problems binding and rebinding commands with Caps_Lock and Shift



commit 14b3848aea8dba8a23ec5368050be184c3ad8bd9
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Dec 8 09:13:06 2011 -0500

    Fix for bug 665804 - Problems binding and rebinding commands with Caps_Lock and Shift

 src/orca/keybindings.py    |   10 +++++-----
 src/orca/orca_gui_prefs.py |   12 +++++++++++-
 2 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/keybindings.py b/src/orca/keybindings.py
index 7d4d63c..a57a9dc 100644
--- a/src/orca/keybindings.py
+++ b/src/orca/keybindings.py
@@ -150,6 +150,11 @@ def getModifierNames(mods):
     text = ""
     if mods & settings.ORCA_MODIFIER_MASK:
         text += _("Orca") + "+"
+    elif mods & (1 << pyatspi.MODIFIER_SHIFTLOCK):
+        # Translators: this is presented in a GUI to represent the
+        # "caps lock" modifier.
+        #
+        text += _("Caps_Lock") + "+"
     #if mods & (1 << pyatspi.MODIFIER_NUMLOCK):
     #    text += _("Num_Lock") + "+"
     if mods & 128:
@@ -179,11 +184,6 @@ def getModifierNames(mods):
         # "control" modifier.
         #
         text += _("Ctrl") + "+"
-    if mods & (1 << pyatspi.MODIFIER_SHIFTLOCK):
-        # Translators: this is presented in a GUI to represent the
-        # "caps lock" modifier.
-        #
-        text += _("Caps_Lock") + "+"
     if mods & settings.SHIFT_MODIFIER_MASK:
         # Translators: this is presented in a GUI to represent the
         # "shift " modifier.
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index a729908..864bf24 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -31,6 +31,7 @@ from gi.repository import Gtk
 from gi.repository import GObject
 from gi.repository import Pango
 import locale
+import pyatspi
 import time
 
 import acss
@@ -2087,8 +2088,13 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
                 text = None
             else:
                 clickCount = self._clickCountToString(kb.click_count)
+                modifierNames = keybindings.getModifierNames(kb.modifiers)
+                try:
+                    keysymstring = kb.keysymstring.encode('UTF-8')
+                except (UnicodeDecodeError, UnicodeEncodeError):
+                    keysymstring = kb.keysymstring
                 text = keybindings.getModifierNames(kb.modifiers) \
-                       + kb.keysymstring \
+                       + keysymstring \
                        + clickCount
 
             model.set_value(myiter, HANDLER, handl)
@@ -2973,6 +2979,10 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
             mods = 0
             clickCount = 1
 
+        if mods & (1 << pyatspi.MODIFIER_SHIFTLOCK) \
+           and mods & settings.ORCA_MODIFIER_MASK:
+            mods ^= (1 << pyatspi.MODIFIER_SHIFTLOCK)
+
         treeModel.set(myiter,
                       modMask, str(settings.defaultModifierMask),
                       modUsed, str(mods),



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