Index: src/orca/orca.py
===================================================================
--- src/orca/orca.py	(revision 2331)
+++ src/orca/orca.py	(working copy)
@@ -670,7 +670,10 @@
     # See if this is one of our special Orca modifiers (e.g., "Insert")
     #
     orcaModifierKeys = settings.orcaModifierKeys
-    isOrcaModifier = orcaModifierKeys.count(keyboardEvent.event_string) > 0
+    orcaModifierKeycodes = []
+    for keysym in orcaModifierKeys:
+        orcaModifierKeycodes.append(keybindings._getKeycode(keysym))
+    isOrcaModifier = orcaModifierKeycodes.count(keyboardEvent.hw_code) > 0
 
     if event.type == atspi.Accessibility.KEY_PRESSED_EVENT:
         # Key presses always interrupt speech.
@@ -894,7 +897,7 @@
 
 def _showAppPreferencesGUI(script=None, inputEvent=None):
     """Displays the user interace to configure the settings for a
-    specific applications within Orca and set up those app-specific 
+    specific applications within Orca and set up those app-specific
     user preferences using a GUI.
 
     Returns True to indicate the input event has been consumed.
Index: src/orca/J2SE-access-bridge.py
===================================================================
--- src/orca/J2SE-access-bridge.py	(revision 2331)
+++ src/orca/J2SE-access-bridge.py	(working copy)
@@ -1,6 +1,6 @@
 # Orca
 #
-# Copyright 2006 Sun Microsystems Inc.
+# Copyright 2006-2007 Sun Microsystems Inc.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
 __id__        = "$Id$"
 __version__   = "$Revision$"
 __date__      = "$Date$"
-__copyright__ = "Copyright (c) 2005-2006 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2005-2007 Sun Microsystems Inc."
 __license__   = "LGPL"
 
 import atspi
@@ -48,7 +48,7 @@
     """
     def __init__(self, script):
         speechgenerator.SpeechGenerator.__init__(self, script)
-        
+
     def _getSpeechForLabel(self, obj, already_focused):
         """Get the speech for a label.
 
@@ -115,7 +115,7 @@
         Returns True if the event is of interest.
         """
         keysym = keyboardEvent.event_string
-        keyboardEvent.hw_code = keybindings._getKeycode(keysym)
+        keyboardEvent.hw_code = keybindings.getKeycode(keysym)
         return default.Script.consumesKeyboardEvent(self, keyboardEvent)
 
     def onFocus(self, event):
@@ -127,27 +127,27 @@
 
         role = event.source.role
         if role == rolenames.ROLE_LIST:
-	    selectedItem = None
-	    selection = event.source.selection
-	    if selection and selection.nSelectedChildren > 0:
-        	selectedItem = atspi.Accessible.makeAccessible(
-            				selection.getSelectedChild(0))
-	    elif event.source.childCount > 0:
-		selectedItem = event.source.child(0)
-	    if selectedItem:
-		orca.setLocusOfFocus(event, selectedItem)
-	    else:
-		# if impossible to get selection or list has 0 items, present list
-		orca.setLocusOfFocus(event, event.source)
-	elif role == rolenames.ROLE_LABEL:
-	    # In FileChooserDemo, when enter in a new folder, a focus event for 
-	    # the top combo box selected item (not SHOWING item) is received.
-	    # Should this check be more specific ?
-	    #
-	    if not event.source.state.count (Accessibility.STATE_SHOWING):
-		return
-	elif role == rolenames.ROLE_MENU:
-    	    # A JMenu has always selection.nSelectedChildren > 0
+            selectedItem = None
+            selection = event.source.selection
+            if selection and selection.nSelectedChildren > 0:
+                selectedItem = atspi.Accessible.makeAccessible(
+                                        selection.getSelectedChild(0))
+            elif event.source.childCount > 0:
+                selectedItem = event.source.child(0)
+            if selectedItem:
+                orca.setLocusOfFocus(event, selectedItem)
+            else:
+                # if impossible to get selection or list has 0 items, present list
+                orca.setLocusOfFocus(event, event.source)
+        elif role == rolenames.ROLE_LABEL:
+            # In FileChooserDemo, when enter in a new folder, a focus event for
+            # the top combo box selected item (not SHOWING item) is received.
+            # Should this check be more specific ?
+            #
+            if not event.source.state.count (Accessibility.STATE_SHOWING):
+                return
+        elif role == rolenames.ROLE_MENU:
+            # A JMenu has always selection.nSelectedChildren > 0
             orca.setLocusOfFocus(event, event.source)
         else:
             default.Script.onFocus(self, event)
@@ -183,33 +183,33 @@
                             if item.state.count(Accessibility.STATE_ARMED):
                                 orca.setLocusOfFocus(event, item)
                                 return
-        
 
-	# In java applications the events are comming in other order:
-	# "focus:" event comes before "state-changed:focused" event
-	#
-	if (event.type == "object:state-changed:focused"):
-	    return
 
+        # In java applications the events are comming in other order:
+        # "focus:" event comes before "state-changed:focused" event
+        #
+        if (event.type == "object:state-changed:focused"):
+            return
+
         # Hand state changes when JTree labels become expanded
         # or collapsed.
         #
         if ((event.source.role == rolenames.ROLE_LABEL) and \
             (event.type == "object:state-changed:expanded")):
             orca.visualAppearanceChanged(event, event.source)
-	    return
+            return
 
-	# Present a value change in case of an focused popup menu.
-	# Fix for Swing file chooser.
-	#
-	if event.type == "object:state-changed:visible" and \
-		event.source.role == rolenames.ROLE_POPUP_MENU and \
-		event.source.parent.state.count(Accessibility.STATE_FOCUSED):
-	    orca.setLocusOfFocus(event, event.source.parent)
-	    return
-	
-	default.Script.onStateChanged(self, event)
+        # Present a value change in case of an focused popup menu.
+        # Fix for Swing file chooser.
+        #
+        if event.type == "object:state-changed:visible" and \
+                event.source.role == rolenames.ROLE_POPUP_MENU and \
+                event.source.parent.state.count(Accessibility.STATE_FOCUSED):
+            orca.setLocusOfFocus(event, event.source.parent)
+            return
 
+        default.Script.onStateChanged(self, event)
+
     def onSelectionChanged(self, event):
         """Called when an object's selection changes.
 
@@ -217,8 +217,8 @@
         - event: the Event
         """
 
-	if not event.source.state.count (atspi.Accessibility.STATE_FOCUSED):
-	    return
+        if not event.source.state.count (atspi.Accessibility.STATE_FOCUSED):
+            return
 
         if event.source.role == rolenames.ROLE_TABLE:
             return
@@ -261,11 +261,11 @@
     def onValueChanged(self, event):
         """Called whenever an object's value changes.  Currently, the
         value changes for non-focused objects are ignored.
-        
+
         Arguments:
         - event: the Event
         """
-        
+
         # We'll let state-changed:checked event to be used to
         # manage check boxes in java application
         #
Index: src/orca/keybindings.py
===================================================================
--- src/orca/keybindings.py	(revision 2331)
+++ src/orca/keybindings.py	(working copy)
@@ -44,7 +44,7 @@
 
 _keycodeCache = {}
 
-def _getKeycode(keysym):
+def getKeycode(keysym):
     """Converts an XKeysym string (e.g., 'KP_Enter') to a keycode that
     should match the event.hw_code for key events.
 
@@ -182,7 +182,7 @@
         # keybindings in the user's preferences file.
         #
         if not self.keycode:
-            self.keycode = _getKeycode(self.keysymstring)
+            self.keycode = getKeycode(self.keysymstring)
 
         if self.keycode == keycode:
             result = modifiers & self.modifier_mask
