mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 22:01:52 +09:00
text input: fixed a bug where pasting would advance the internal cursor but the actual text wouldn't go in
This commit is contained in:
@@ -280,6 +280,11 @@ class UIItemTextLineInput(
|
||||
tryCursorBack()
|
||||
}
|
||||
}
|
||||
else if (keycodes.containsSome(Input.Keys.ENTER, Input.Keys.NUMPAD_ENTER)) {
|
||||
endComposing()
|
||||
|
||||
println("END COMPOSING!!")
|
||||
}
|
||||
// accept:
|
||||
// - literal "<"
|
||||
// - keysymbol that does not start with "<" (not always has length of 1 because UTF-16)
|
||||
@@ -321,13 +326,13 @@ class UIItemTextLineInput(
|
||||
moveCursorToEnd(codepoints.size)
|
||||
}
|
||||
}
|
||||
else if (keycodes.containsSome(Input.Keys.ENTER, Input.Keys.NUMPAD_ENTER)) {
|
||||
endComposing()
|
||||
}
|
||||
|
||||
// don't put innards of tryCursorBack/Forward here -- you absolutely don't want that behaviour
|
||||
}
|
||||
}
|
||||
catch (e: IndexOutOfBoundsException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
catch (e: NullPointerException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
@@ -341,6 +346,7 @@ class UIItemTextLineInput(
|
||||
}
|
||||
|
||||
fboUpdateLatch = true
|
||||
|
||||
}
|
||||
|
||||
override fun update(delta: Float) {
|
||||
@@ -418,6 +424,7 @@ class UIItemTextLineInput(
|
||||
|
||||
actuallyInserted.removeAt(0)
|
||||
|
||||
textbuf.addAll(actuallyInserted)
|
||||
moveCursorToEnd(actuallyInserted.size)
|
||||
|
||||
tryCursorBack()
|
||||
|
||||
Reference in New Issue
Block a user