         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) {

            
            return true
        }
        else {
            switch self.shiftState {
            case .Disabled:
                self.shiftState = .Disabled
            case .Enabled:
                self.shiftState = .Disabled
            case .Locked:
                self.shiftState = .Locked
            }
            
            return false
        }
    }
    
    func characterIsPunctuation(character: Character) -> Bool {
