diff --git a/src/orca/orca.py b/src/orca/orca.py
index e69c357..6871334 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -828,6 +828,8 @@ def _processKeyboardEvent(event):
     elif isOrcaModifier \
         and (keyboardEvent.type == pyatspi.KEY_RELEASED_EVENT):
         _orcaModifierPressed = False
+        if orca_state.clearedLock and orca_state.bypassNextCommand:
+            os.system('xmodmap -e "add Lock = Caps_Lock"')
 
     if _orcaModifierPressed:
         keyboardEvent.modifiers = keyboardEvent.modifiers \
@@ -882,9 +884,11 @@ def _processKeyboardEvent(event):
                 consumed = True
 
             if not consumed \
-               and not isModifierKey(keyboardEvent.event_string) \
                and keyboardEvent.type == pyatspi.KEY_PRESSED_EVENT:
+                if orca_state.bypassNextCommand and orca_state.clearedLock:
+                    os.system('xmodmap -e "clear Lock"')
                 orca_state.bypassNextCommand = False
+
     except:
         debug.printException(debug.LEVEL_SEVERE)
 
