mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +09:00
34 lines
1.0 KiB
Kotlin
34 lines
1.0 KiB
Kotlin
package net.torvald.terrarum.modulebasegame.console
|
|
|
|
import com.badlogic.gdx.Gdx
|
|
import com.badlogic.gdx.Input
|
|
import net.torvald.terrarum.console.ConsoleCommand
|
|
import net.torvald.terrarum.console.Echo
|
|
//import net.torvald.terrarum.swingapp.IMStringReader
|
|
|
|
/**
|
|
* Created by minjaesong on 2017-02-05.
|
|
*/
|
|
|
|
internal object JavaIMTest : ConsoleCommand {
|
|
|
|
override fun execute(args: Array<String>) {
|
|
/*IMStringReader(
|
|
{ Echo("[JavaIMTest -> IMStringReader] $it") }, // send input to Echo
|
|
"JavaIMTest"
|
|
)*/
|
|
val inputListener = object : Input.TextInputListener {
|
|
override fun input(text: String?) {
|
|
Echo("[TextInputText] $text")
|
|
}
|
|
override fun canceled() {
|
|
Echo("[TextInputText] (input canceled)")
|
|
}
|
|
}
|
|
Gdx.input.getTextInput(inputListener, "TextInputTest", "", "type anything!")
|
|
}
|
|
|
|
override fun printUsage() {
|
|
Echo("Tests Swing input window to get non-English text input")
|
|
}
|
|
} |