From 320458ead7a29b1bd28b74bb926dd7b262cfa0a1 Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Sun, 19 Oct 2014 17:38:22 -0500 Subject: [PATCH] Added more comments. --- src/eventReceiver.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/eventReceiver.cpp b/src/eventReceiver.cpp index 6f41175..e20039c 100644 --- a/src/eventReceiver.cpp +++ b/src/eventReceiver.cpp @@ -1,18 +1,23 @@ #include "eventReceiver.h" +// Initialize EventReceiver::EventReceiver() { + // Set all keys to false, because none of them are pressed for(u32 i = 0; i < KEY_KEY_CODES_COUNT; i++) { KeyIsDown[i] = false; } } bool EventReceiver::OnEvent(const SEvent &event) { + // If the input event is a key press if(event.EventType == irr::EET_KEY_INPUT_EVENT) { + // Set our keyIsDown variable to the event one KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; } return false; } const bool EventReceiver::IsKeyDown(EKEY_CODE keyCode) { + // Return if the key is down return KeyIsDown[keyCode]; }