fixed a bug caused by lwjgl3 where Ctrl-<alph> won't be recognised

This commit is contained in:
minjaesong
2021-09-23 22:30:28 +09:00
parent f26b9bc9b1
commit 96e23d9019
5 changed files with 126 additions and 75 deletions

View File

@@ -318,9 +318,14 @@ class IOSpace(val vm: VM) : PeriBase, InputProcessor {
)
override fun keyDown(p0: Int): Boolean {
if (keyboardInputRequested) {
specialKeys[p0]?.let {
//println("[IO] key special = ${it.toUInt()}")
keyboardBuffer.appendHead(it)
if (p0 in Input.Keys.A..Input.Keys.Z && (Gdx.input.isKeyPressed(Input.Keys.CONTROL_LEFT) || Gdx.input.isKeyPressed(Input.Keys.CONTROL_RIGHT))) {
keyboardBuffer.appendHead((p0 - 28).toByte())
}
else {
specialKeys[p0]?.let {
//println("[IO] key special = ${it.toUInt()}")
keyboardBuffer.appendHead(it)
}
}
return true
}