still working on vt, still buggy :/

Former-commit-id: 9164ca8ef33917f7254c65f3947903b8a17dd654
Former-commit-id: 3ebf64f00a0b86d11a449c1d399e149f2714839c
This commit is contained in:
Song Minjae
2017-03-03 04:05:00 +09:00
parent 122305cad4
commit 7bd1ed1bcf
9 changed files with 61 additions and 127 deletions

View File

@@ -343,37 +343,6 @@ open class SimpleTextTerminal(
var sb: StringBuilder = StringBuilder()
private var inputOpen = false
private var keyPressVisible = false
/**
* @param echo if true, keypresses are echoed to the terminal.
*/
override fun openInput(echo: Boolean) {
lastStreamInput = null
lastKeyPress = null
inputOpen = true
keyPressVisible = echo
if (DEBUG) println("[SimpleTextTerminal] openInput()")
}
override fun closeInputKey(keyFromUI: Int): Int {
inputOpen = false
lastKeyPress = keyFromUI
if (DEBUG) println("[SimpleTextTerminal] closeInputKey(), $keyFromUI")
return keyFromUI
}
override var lastStreamInput: String? = null
override var lastKeyPress: Int? = null
override fun closeInputString(): String {
inputOpen = false
lastStreamInput = sb.toString()
sb = StringBuilder()
if (DEBUG)
println("[SimpleTextTerminal] closeInputString(), ${if (keyPressVisible) lastStreamInput else "<keypress hidden>"}")
return lastStreamInput!!
}
override fun keyPressed(key: Int, c: Char) {
lastInputByte = c.toInt()