keyboard control ported to GDX (at least as much as I can right now)

This commit is contained in:
minjaesong
2017-07-01 18:31:00 +09:00
parent f2a2966d6c
commit cbcd32e132
25 changed files with 298 additions and 327 deletions

View File

@@ -10,40 +10,43 @@ import net.torvald.terrarum.virtualcomputer.terminal.Terminal
* Created by minjaesong on 16-09-08.
*/
class UITextTerminal(val terminal: Terminal) : UICanvas, KeyControlled, MouseControlled {
override fun mouseMoved(oldx: Int, oldy: Int, newx: Int, newy: Int) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
override fun keyDown(keycode: Int): Boolean {
return false
}
override fun keyPressed(key: Int, c: Char) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
override fun mouseMoved(screenX: Int, screenY: Int): Boolean {
return false
}
override fun keyReleased(key: Int, c: Char) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
override fun keyUp(keycode: Int): Boolean {
return false
}
override fun mouseDragged(oldx: Int, oldy: Int, newx: Int, newy: Int) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean {
return false
}
override fun controllerButtonPressed(controller: Int, button: Int) {
override fun keyTyped(character: Char): Boolean {
return false
}
override fun controllerButtonReleased(controller: Int, button: Int) {
override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
return false
}
override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
return false
}
override fun scrolled(amount: Int): Boolean {
return false
}
override var width: Int = terminal.displayW// + some
override var height: Int = terminal.displayH// + frame
override fun mousePressed(button: Int, x: Int, y: Int) {
// monitor on/off, reset switch
}
override fun mouseReleased(button: Int, x: Int, y: Int) {
}
override fun mouseWheelMoved(change: Int) {
}
/**
* Usage: (in StateInGame:) uiHandlerField.ui.handler = uiHandlerField