commit 9828440d95d133c71f16c173ca03c3dd197749cf
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Wed Dec 31 12:06:42 2025 -0700
Commit: Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Wed Dec 31 12:06:42 2025 -0700
Make stat(31) clear kbdown to match pico 8
Fixes infinite loop in terra
---
source/Input.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source/Input.cpp b/source/Input.cpp
index 5ec5bfc..e430d45 100644
--- a/source/Input.cpp
+++ b/source/Input.cpp
@@ -114,6 +114,10 @@ bool Input::getKeyDown() {
}
const char* Input::getKey() {
+ // Found this bug in Terra
+ // PICO-8 behavior: stat(31) appears to consume the key from the buffer
+ // After reading, stat(30) should return false until next key press
+ _kbDown = false;
return _kbKey.c_str();
}