eros: register key account add callbacks in postInit, fixes #37

This commit is contained in:
Bixilon 2021-08-31 15:12:22 +02:00
parent fa84eff093
commit 129ca3f78e
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 10 additions and 0 deletions

View File

@ -81,6 +81,11 @@ class MojangAddController(
passwordFX.textProperty().addListener { _, _, _ ->
validate()
}
}
override fun postInit() {
super.postInit()
stage.scene.root.addEventFilter(KeyEvent.KEY_PRESSED) {
if (it.code == KeyCode.ENTER) {
login()

View File

@ -66,6 +66,11 @@ class OfflineAddController(
usernameFX.textProperty().addListener { _, _, new ->
addButtonFX.isDisable = !ProtocolDefinition.MINECRAFT_NAME_VALIDATOR.matcher(new).matches()
}
}
override fun postInit() {
super.postInit()
stage.scene.root.addEventFilter(KeyEvent.KEY_PRESSED) {
if (it.code == KeyCode.ENTER) {
add()