     
     func setCapsIfNeeded() -> Bool {
         if self.shouldAutoCapitalize() {
-            switch self.shiftState {
-            case .Disabled:
-                self.shiftState = .Enabled
-            case .Enabled:
-                self.shiftState = .Enabled
-            case .Locked:
-                self.shiftState = .Locked
-            }
+            self.shiftState = (self.shiftState == .Locked) ? .Locked : .Enabled
             
             return true
         }
         else {
-            switch self.shiftState {
-            case .Disabled:
-                self.shiftState = .Disabled
-            case .Enabled:
-                self.shiftState = .Disabled
-            case .Locked:
-                self.shiftState = .Locked
-            }
+            self.shiftState = (self.shiftState == .Locked) ? .Locked : .Disabled
             
             return false
         }

		self.view.sendSubviewToBack(self.bannerView!)
		
		let proxy = textDocumentProxy
		if proxy.keyboardType == UIKeyboardType.NumberPad || proxy.keyboardType == UIKeyboardType.DecimalPad
		{
			
		}
		else
		{
			sender.showPopup()
		}

                return
            }
            else {
                self.shiftState = (self.shiftState == .Disabled) ? .Enabled : .Disabled
                (sender.shape as? ShiftShape)?.withLock = false
            }
        }
