         if let textDocumentProxy = self.textDocumentProxy as? UIKeyInput {
             textDocumentProxy.deleteBackward()
         }
+        self.setCapsIfNeeded()
         
         // trigger for subsequent deletes
         self.backspaceDelayTimer = NSTimer.scheduledTimerWithTimeInterval(backspaceDelay - backspaceRepeat, target: self, selector: Selector("backspaceDelayCallback"), userInfo: nil, repeats: false)

            // TODO: reset context
        }
        
        var capsWasChanged = self.setCapsIfNeeded()
        
        if !capsWasChanged {
            if self.shiftState == ShiftState.Enabled {
                self.shiftState = ShiftState.Disabled
            }
        }
    }
    
    func handleAutoPeriod(key: Key) {

        if let textDocumentProxy = self.textDocumentProxy as? UIKeyInput {
            textDocumentProxy.deleteBackward()
        }
        self.setCapsIfNeeded()
    }
    
    func shiftDown(sender: KeyboardKey) {
