added X button to mimic the end button
[physics.git] / src / input / inputManager.cpp
index ebbd72e..21934c4 100644 (file)
@@ -18,6 +18,8 @@
 #include "inputManager.h"
 #include "../debug.h"
 
+#include "../config/keys.h"
+
 
 /// ***** Private Variables *****
 
@@ -68,6 +70,9 @@ void input::update()
         case SDL_KEYDOWN:
             keyState[event.key.keysym.sym] = wasP;
             break;
+        case SDL_QUIT:
+            keyState[key::end] = wasR;
+            break;
         }
     }
 }
@@ -93,20 +98,20 @@ bool input::mouseRight()
     return state & SDL_BUTTON(3);
 }
 
-bool input::isPressed(Uint8 key)
+bool input::isPressed(SDLKey key)
 {
     return keyState[key] == isP || keyState[key] == wasP;
 }
-bool input::isReleased(Uint8 key)
+bool input::isReleased(SDLKey key)
 {
     return keyState[key] == isR || keyState[key] == wasR;
 }
 
-bool input::wasPressed(Uint8 key)
+bool input::wasPressed(SDLKey key)
 {
     return keyState[key] == wasP;
 }
-bool input::wasReleased(Uint8 key)
+bool input::wasReleased(SDLKey key)
 {
     return keyState[key] == wasR;
 }