typewriting sound on typewriter

This commit is contained in:
minjaesong
2021-11-26 15:27:09 +09:00
parent 94a40a4a87
commit b83dd501fc
15 changed files with 123 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ class InputStrober(val typewriter: TypewriterGDX) {
// println("Key strobed: ${keys.joinToString()}")
if (stroboStatus % 2 == 0 && keys[0] != 0) {
if (stroboStatus % 2 == 0 && (keys[0] != 0 || oldKeys[0] != 0)) {
stroboStatus += 1
stroboTime = System.nanoTime()
repeatCount += 1
@@ -73,6 +73,13 @@ class InputStrober(val typewriter: TypewriterGDX) {
// App.inputStrobed(TerrarumKeyboardEvent(KEY_DOWN, newKeysym, headKeyCode, repeatCount, keys))
typewriter.acceptKey(headKeyCode)
}
// println("shiftin=${shiftin} oldkeys=${oldKeys.joinToString()}")
if (!shiftin && (oldKeys.contains(Input.Keys.SHIFT_LEFT) || oldKeys.contains(Input.Keys.SHIFT_RIGHT))) {
typewriter.shiftOut()
}
}
oldKeys = keys // don't put this outside of if-cascade