Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
[fix] Searching breaks setting value typing, enter key in string setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna5ama committed Jan 12, 2021
1 parent 486f276 commit 254d6fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/me/zeroeightsix/kami/gui/AbstractKamiGui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ abstract class AbstractKamiGui<S : SettingWindow<*>, E : Any> : GuiScreen() {
}

override fun keyTyped(typedChar: Char, keyCode: Int) {
if (settingWindow?.listeningChild != null) return
when {
keyCode == Keyboard.KEY_BACK || keyCode == Keyboard.KEY_DELETE -> {
typedString = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class StringButton(val setting: StringSetting) : BooleanSlider(setting.name, 1.0
if (keyState) {
when (keyCode) {
Keyboard.KEY_RETURN -> {
onStopListening(true)
}
Keyboard.KEY_BACK, Keyboard.KEY_DELETE -> {
name = name.substring(0, max(name.length - 1, 0))
Expand Down

0 comments on commit 254d6fc

Please sign in to comment.