|
@@ -273,6 +273,28 @@ extension KMResetPasswordView: NSTextFieldDelegate {
|
|
|
self.presenter.changeRePassword(string: textField!.stringValue)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool {
|
|
|
+ switch commandSelector {
|
|
|
+ case #selector(NSResponder.insertNewline(_:)):
|
|
|
+ if let inputView = control as? NSTextField {
|
|
|
+ //当当前TextField按下enter
|
|
|
+ if (textView.string == self.passwordTextField.stringValue ||
|
|
|
+ textView.string == self.passwordSecureTextField.stringValue ||
|
|
|
+ textView.string == self.rePasswordTextField.stringValue ||
|
|
|
+ textView.string == self.rePasswordSecureTextField.stringValue) {
|
|
|
+ print("按下 enter")
|
|
|
+
|
|
|
+ if self.model.canNext {
|
|
|
+ self.doneButtonAction(self.doneButton)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ default:
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
extension KMResetPasswordView: KMRegisterPresenterDelegate {
|