* Make the InputTask quit the program on escape.
[matthijs/ABM2.git] / ABM2 / Engine / InputTask.cpp
index 54e71cbca99d73ae76a637ffcfa38ac3ef57d8c8..61d51126a07f426a4e5dc6e7f4085ee619d5423d 100755 (executable)
@@ -51,8 +51,11 @@ void CInputTask::Update()
        SDL_PumpEvents();\r
        oldButtons=buttons;\r
        buttons=SDL_GetRelativeMouseState(&dX,&dY);\r
-       memcpy((unsigned char*)(*oldKeys),keys,sizeof(unsigned char)*keyCount);\r
+       memcpy(oldKeys,keys,sizeof(unsigned char)*keyCount);\r
        keys=SDL_GetKeyState(&keyCount);\r
+\r
+       if (keyDown(SDLK_ESCAPE))\r
+               this->getKernel()->KillAllTasks();\r
 }\r
 \r
 void CInputTask::Stop()\r