     }
     
     func shiftDown(sender: KeyboardKey) {
+        self.shiftStartingState = self.shiftState
+        
+        if let shiftStartingState = self.shiftStartingState {
+            if shiftStartingState.uppercase() {
+                // handled by shiftUp
+                return
+            }
+            else {
+                switch self.shiftState {
+                case .Disabled:
+                    self.shiftState = .Enabled
+                case .Enabled:
+                    self.shiftState = .Disabled
+                case .Locked:
+                    self.shiftState = .Disabled
+                }
+                
+                (sender.shape as? ShiftShape)?.withLock = false
+            }
+        }
+    }
+    
+    func shiftUp(sender: KeyboardKey) {
         if self.shiftWasMultitapped {
             self.shiftWasMultitapped = false
             return
         }
         
-        switch self.shiftState {
-        case .Disabled:
-            self.shiftState = .Enabled
-        case .Enabled:
-            self.shiftState = .Disabled
-        case .Locked:
-            self.shiftState = .Disabled
-        }
-        
-        (sender.shape as? ShiftShape)?.withLock = false
+        if let shiftStartingState = self.shiftStartingState {
+            if !shiftStartingState.uppercase() {
+                // handled by shiftDown
+                return
+            }
+            else {
+                switch self.shiftState {
+                case .Disabled:
+                    self.shiftState = .Enabled
+                case .Enabled:
+                    self.shiftState = .Disabled
+                case .Locked:
+                    self.shiftState = .Disabled
+                }
+                
+                (sender.shape as? ShiftShape)?.withLock = false
+            }
+        }
+        
+        self.shiftStartingState = nil
     }
     
     func shiftDoubleTapped(sender: KeyboardKey) {

                            keyView.addTarget(self, action: "backspaceDown:", forControlEvents: .TouchDown)
                            keyView.addTarget(self, action: "backspaceUp:", forControlEvents: cancelEvents)
                        case Key.KeyType.Shift:
                            keyView.addTarget(self, action: Selector("shiftDown:"), forControlEvents: .TouchUpInside)
                            keyView.addTarget(self, action: Selector("shiftDoubleTapped:"), forControlEvents: .TouchDownRepeat)
                        case Key.KeyType.ModeChange:
                            keyView.addTarget(self, action: Selector("modeChangeTapped:"), forControlEvents: .TouchUpInside)
                        case Key.KeyType.Settings:
                            keyView.addTarget(self, action: Selector("toggleSettings"), forControlEvents: .TouchUpInside)
                        default:

                            keyView.addTarget(self, action: "keyPressedHelper:", forControlEvents: .TouchUpInside)
                        }
                        
                        if key.type != Key.KeyType.Shift && key.type != Key.KeyType.ModeChange {
                            keyView.addTarget(self, action: Selector("highlightKey:"), forControlEvents: .TouchDown | .TouchDragInside | .TouchDragEnter)
                            keyView.addTarget(self, action: Selector("unHighlightKey:"), forControlEvents: .TouchUpInside | .TouchUpOutside | .TouchDragOutside | .TouchDragExit | .TouchCancel)
                        }
