         }
     }
     
-    // TODO: make this work if cursor position is shifted
     func setCapsIfNeeded() -> Bool {
         if self.shouldAutoCapitalize() {
             switch self.shiftState {

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

            
            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 {
