 	case Enabled
 	/// Shift is locked-- continue to type capitals.
 	case Locked
+	
+	mutating func enableIfDisabled() {
+		if self == .Disabled {
+			self = .Enabled
+		}
+	}
 }
 
 class KeyboardViewController: UIInputViewController {

			let loc = sender.locationInView(view)
			let subview = view.hitTest(loc, withEvent: nil)
			if let subview = subview as? KeyboardKey {
				typeLetter(subview.letter)
			} else if let subview = subview as? Spacebar {
				typeLetter(" ")
			}
		}
	}

	/// TODO: Fix this once `documentContextBeforeInput` stops always returning nil.
	/// Did a left swipe gesture. Delete until previous chunk of whitespace.
	func didSwipeLeft(sender: UIGestureRecognizer) {
		if sender.state == .Ended {
			self.deleteWord()
		}
	}
	
	/// Did a right swipe gesture. Add period and a space character.
	func didSwipeRight(sender: UIGestureRecognizer) {
		if sender.state == .Ended {
			self.typeString(". ")
			self.shiftState.enableIfDisabled()
		}
	}
	
	func deleteKeyPressed(sender: UIButton) {
