소스 검색

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;