Skip to content

Commit e43e8ee

Browse files
committed
Improve usability
1 parent 7e3ccef commit e43e8ee

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/main/kotlin/com/lambda/client/gui/rgui/component/StringButton.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,19 @@ class StringButton(val setting: StringSetting) : BooleanSlider(setting.name, 1.0
6767

6868
when (keyCode) {
6969
Keyboard.KEY_V, Keyboard.KEY_INSERT -> {
70-
if (!GuiScreen.isCtrlKeyDown() && keyCode == Keyboard.KEY_V) componentName += typedChar
71-
else {
72-
componentName = GuiScreen.getClipboardString()
73-
onStopListening(true)
70+
if (!GuiScreen.isCtrlKeyDown() && keyCode == Keyboard.KEY_V) {
71+
componentName += typedChar
72+
} else {
73+
componentName += GuiScreen.getClipboardString().trim()
7474
}
7575
}
76-
7776
Keyboard.KEY_C -> {
78-
if (!GuiScreen.isCtrlKeyDown()) componentName += typedChar
79-
else {
77+
if (GuiScreen.isCtrlKeyDown()) {
8078
GuiScreen.setClipboardString(componentName)
81-
onStopListening(true)
79+
} else {
80+
componentName += typedChar
8281
}
8382
}
84-
8583
Keyboard.KEY_RETURN -> onStopListening(true)
8684
Keyboard.KEY_BACK -> componentName = componentName.dropLast(1)
8785
Keyboard.KEY_DELETE -> componentName = ""

0 commit comments

Comments
 (0)