mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +09:00
3set: delete by letter pieces when assemblying
This commit is contained in:
@@ -12,6 +12,7 @@ data class TerrarumInputMethod(
|
||||
val name: String,
|
||||
// (headkey, shiftin, altgrin)
|
||||
val acceptChar: (Int, Boolean, Boolean) -> Pair<String, String>, // Pair<Display Char, Output Char if any>
|
||||
val backspace: () -> String,
|
||||
val endCompose: () -> String,
|
||||
val reset: () -> Unit,
|
||||
val composing: () -> Boolean
|
||||
@@ -109,6 +110,8 @@ object IME {
|
||||
return TerrarumInputMethod(name, { headkey, shifted, alted ->
|
||||
val a = jsval.invokeMember("accept", headkey, shifted, alted)
|
||||
a.getArrayElement(0).asString() to a.getArrayElement(1).asString()
|
||||
}, {
|
||||
jsval.invokeMember("backspace").asString()
|
||||
}, {
|
||||
jsval.invokeMember("end").asString()
|
||||
}, {
|
||||
|
||||
@@ -176,8 +176,7 @@ class UIItemTextLineInput(
|
||||
}
|
||||
else if (keycodes.contains(Input.Keys.BACKSPACE)) {
|
||||
if (ime != null && ime.composing()) {
|
||||
// TODO ime.backspace() instead of resetIME()
|
||||
resetIME()
|
||||
composingView = CodepointSequence(ime.backspace().toCodePoints())
|
||||
}
|
||||
else if (cursorX <= 0) {
|
||||
cursorX = 0
|
||||
@@ -185,6 +184,7 @@ class UIItemTextLineInput(
|
||||
cursorDrawScroll = 0
|
||||
}
|
||||
else {
|
||||
endComposing()
|
||||
if (cursorX > 0) {
|
||||
while (true) {
|
||||
cursorX -= 1
|
||||
|
||||
Reference in New Issue
Block a user