@@ -66,16 +66,18 @@ class KeybindSettingCore(defaultValue: Bind) : SettingCore<Bind>(
6666 if (listening) " Press any key…"
6767 else bind.name
6868
69- if (listening) {
70- withStyleColor(ImGuiCol .Button , 0.20f , 0.50f , 1.00f , 1.00f ) {
71- withStyleColor(ImGuiCol .ButtonHovered , 0.25f , 0.60f , 1.00f , 1.00f ) {
72- withStyleColor(ImGuiCol .ButtonActive , 0.20f , 0.50f , 0.95f , 1.00f ) {
73- button(preview)
69+ withId(" ##Bind-${this @KeybindSettingCore.hashCode()} " ) {
70+ if (listening) {
71+ withStyleColor(ImGuiCol .Button , 0.20f , 0.50f , 1.00f , 1.00f ) {
72+ withStyleColor(ImGuiCol .ButtonHovered , 0.25f , 0.60f , 1.00f , 1.00f ) {
73+ withStyleColor(ImGuiCol .ButtonActive , 0.20f , 0.50f , 0.95f , 1.00f ) {
74+ button(preview)
75+ }
7476 }
7577 }
78+ } else {
79+ button(preview) { listening = true }
7680 }
77- } else {
78- button(preview) { listening = true }
7981 }
8082
8183 lambdaTooltip {
@@ -88,7 +90,7 @@ class KeybindSettingCore(defaultValue: Bind) : SettingCore<Bind>(
8890 }
8991
9092 sameLine()
91- smallButton( " Unbind" ) {
93+ withId( " ## Unbind- ${ this @KeybindSettingCore.hashCode()} " ) {
9294 value = Bind .EMPTY
9395 listening = false
9496 }
0 commit comments