seemingly working hangul 2-set

This commit is contained in:
minjaesong
2021-10-23 15:15:39 +09:00
parent 5ef8f3cea4
commit 1141638fc3
4 changed files with 470 additions and 36 deletions

View File

@@ -101,8 +101,8 @@ object IME {
}
private fun parseImeFile(file: File): TerrarumInputMethod {
val src = file.readText(Charsets.UTF_8)
val jsval = context.eval("js", "'use strict';$src")
val code = file.readText(Charsets.UTF_8)
val jsval = context.eval("js", "\"use strict\";(function(){$code})()")
val name = jsval.getMember("n").asString()

View File

@@ -155,6 +155,7 @@ class UIItemTextLineInput(
override fun update(delta: Float) {
super.update(delta)
val mouseDown = Terrarum.mouseDown
val oldActive = isActive
if (mouseDown) {
isActive = mouseUp
@@ -242,6 +243,7 @@ class UIItemTextLineInput(
tryCursorBack()
}
}
// TODO IME endComposing() on hitting Enter
// don't put innards of tryCursorBack/Forward here -- you absolutely don't want that behaviour
@@ -258,6 +260,9 @@ class UIItemTextLineInput(
cursorOn = !cursorOn
}
}
else if (oldActive) { // just became disactivated
// TODO IME endComposing()
}
if (mouseDown && !mouseLatched && (enablePasteButton && enableIMEButton && mouseUpOnButton1 || enableIMEButton && !enablePasteButton && mouseUpOnButton2)) {
toggleIME()