瀏覽代碼

StateMachine: wait until the key is released before popping a state

Streetwalrus Einstein 10 年之前
父節點
當前提交
9a2f1c356a
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/engine/StateMachine.cpp

+ 4 - 0
src/engine/StateMachine.cpp

@@ -61,7 +61,11 @@ void STATEMACHINE::run()
         }
 
         if (isKeyPressed(KEY_NSPIRE_ESC))
+        {
+            while (isKeyPressed(KEY_NSPIRE_ESC))
+                ;
             this->pop();
+        }
 
         while (Timers::read(0) < loop_next);
         loop_next += loop_time;