[fix] Searching breaks setting value typing, enter key in string setting

This commit is contained in:
Xiaro 2021-01-12 10:41:46 -05:00
parent 486f276526
commit 254d6fc1f6
No known key found for this signature in database
GPG Key ID: 996D265D6E155377
2 changed files with 2 additions and 0 deletions

View File

@ -235,6 +235,7 @@ abstract class AbstractKamiGui<S : SettingWindow<*>, E : Any> : GuiScreen() {
} }
override fun keyTyped(typedChar: Char, keyCode: Int) { override fun keyTyped(typedChar: Char, keyCode: Int) {
if (settingWindow?.listeningChild != null) return
when { when {
keyCode == Keyboard.KEY_BACK || keyCode == Keyboard.KEY_DELETE -> { keyCode == Keyboard.KEY_BACK || keyCode == Keyboard.KEY_DELETE -> {
typedString = "" typedString = ""

View File

@ -59,6 +59,7 @@ class StringButton(val setting: StringSetting) : BooleanSlider(setting.name, 1.0
if (keyState) { if (keyState) {
when (keyCode) { when (keyCode) {
Keyboard.KEY_RETURN -> { Keyboard.KEY_RETURN -> {
onStopListening(true)
} }
Keyboard.KEY_BACK, Keyboard.KEY_DELETE -> { Keyboard.KEY_BACK, Keyboard.KEY_DELETE -> {
name = name.substring(0, max(name.length - 1, 0)) name = name.substring(0, max(name.length - 1, 0))