mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +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()
|
tryCursorBack()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (keycodes.containsSome(Input.Keys.ENTER, Input.Keys.NUMPAD_ENTER)) {
|
||||||
|
endComposing()
|
||||||
|
|
||||||
|
println("END COMPOSING!!")
|
||||||
|
}
|
||||||
// accept:
|
// accept:
|
||||||
// - literal "<"
|
// - literal "<"
|
||||||
// - keysymbol that does not start with "<" (not always has length of 1 because UTF-16)
|
// - keysymbol that does not start with "<" (not always has length of 1 because UTF-16)
|
||||||
@@ -321,13 +326,13 @@ class UIItemTextLineInput(
|
|||||||
moveCursorToEnd(codepoints.size)
|
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
|
// don't put innards of tryCursorBack/Forward here -- you absolutely don't want that behaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (e: IndexOutOfBoundsException) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
catch (e: NullPointerException) {
|
catch (e: NullPointerException) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
@@ -341,6 +346,7 @@ class UIItemTextLineInput(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fboUpdateLatch = true
|
fboUpdateLatch = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun update(delta: Float) {
|
override fun update(delta: Float) {
|
||||||
@@ -418,6 +424,7 @@ class UIItemTextLineInput(
|
|||||||
|
|
||||||
actuallyInserted.removeAt(0)
|
actuallyInserted.removeAt(0)
|
||||||
|
|
||||||
|
textbuf.addAll(actuallyInserted)
|
||||||
moveCursorToEnd(actuallyInserted.size)
|
moveCursorToEnd(actuallyInserted.size)
|
||||||
|
|
||||||
tryCursorBack()
|
tryCursorBack()
|
||||||
|
|||||||
Reference in New Issue
Block a user