class Key { private: int state; public: bool up(); bool down(); bool dead(); } class EventObject { private: SDL_Event event; int type; //Event type, keyboard, mouse, joystick/gamepad int eventKey; //Which key the event is from public: bool poll(); //Poll for an event int getKey(); //Return which key the event took place at KeyObject key; //An updated key object }; EventObject::poll() { SDL_PollEvent(event); //[sudo code] if event is a keyevent { update type; update eventKey; //Which key the event came from update the key; //update the key itself } if an event took place { return true; } return false; //[/sudo code] } inputEngine.Update(EventObject &event) { if (event.type == KEY_EVENT) { Keyboard.Keys[event.getKey()] = event.key; //Just the single key is updated } }