aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/gui/config/KeyBindingHandler.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/gui/config/KeyBindingHandler.kt')
-rw-r--r--src/main/kotlin/gui/config/KeyBindingHandler.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/gui/config/KeyBindingHandler.kt b/src/main/kotlin/gui/config/KeyBindingHandler.kt
index 0cf0c46..d7d0b47 100644
--- a/src/main/kotlin/gui/config/KeyBindingHandler.kt
+++ b/src/main/kotlin/gui/config/KeyBindingHandler.kt
@@ -6,7 +6,6 @@ import io.github.notenoughupdates.moulconfig.deps.libninepatch.NinePatch
import io.github.notenoughupdates.moulconfig.gui.GuiImmediateContext
import io.github.notenoughupdates.moulconfig.gui.KeyboardEvent
import io.github.notenoughupdates.moulconfig.gui.component.TextComponent
-import org.lwjgl.glfw.GLFW
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.decodeFromJsonElement
@@ -34,7 +33,10 @@ class KeyBindingHandler(val name: String, val managedConfig: ManagedConfig) :
lateinit var button: FirmButtonComponent
val sm = KeyBindingStateManager(
{ opt.value },
- { opt.value = it },
+ {
+ opt.value = it
+ opt.element.save()
+ },
{ button.blur() },
{ button.requestFocus() }
)