Pārlūkot izejas kodu

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

Streetwalrus Einstein 10 gadi atpakaļ
vecāks
revīzija
9a2f1c356a
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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;