Index: consts.hpp
===================================================================
--- consts.hpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ consts.hpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -12,9 +12,3 @@
 constexpr unsigned char GUI_FLAGS_WINDOW_FULLSCREEN { 1 << 0 };
 
-/*
-constexpr unsigned char RTWO_KEY_EVENT_NONE { 0 };
-constexpr unsigned char RTWO_KEY_EVENT_PRESSED { 1 };
-constexpr unsigned char RTWO_KEY_EVENT_RELEASED { 2 };
-*/
-
 #endif // _RTWO_CONSTS_H
Index: game-gui-glfw.cpp
===================================================================
--- game-gui-glfw.cpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ game-gui-glfw.cpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -1,14 +1,8 @@
 #include "game-gui-glfw.hpp"
-
-#include <queue>
 
 #include "compiler.hpp"
 #include "consts.hpp"
 
-int GameGui_GLFW::s_keyState[GLFW_KEY_LAST];
-bool GameGui_GLFW::s_keyDown[GLFW_KEY_LAST];
-
-// queue<MouseEvent> mouseEvents;
-
+queue<UIEvent> GameGui_GLFW::s_events;
 string GameGui_GLFW::s_errorMessage;
 
@@ -32,5 +26,4 @@
 
 void* GameGui_GLFW::createWindow(const string& title, int width, int height, bool fullscreen) {
-   GLFWwindow* window = nullptr;
    GLFWmonitor* mon = nullptr;
 
@@ -62,11 +55,7 @@
 
    window = glfwCreateWindow(windowWidth, windowHeight, title.c_str(), mon, nullptr);
-   //glfwMakeContextCurrent(window);
 
    glfwSetMouseButtonCallback(window, glfw_mouse_button_callback);
    glfwSetKeyCallback(window, glfw_key_callback);
-
-   // fill(s_keyState, s_keyState + GLFW_KEY_LAST, RTWO_KEY_EVENT_NONE);
-   // fill(s_keyDown, s_keyDown + GLFW_KEY_LAST, false);
 
    return window;
@@ -78,30 +67,25 @@
 }
 
-/*
 void GameGui_GLFW::processEvents() {
-   fill(s_keyState, s_keyState + GLFW_KEY_LAST, RTWO_KEY_EVENT_NONE);
+   glfwPollEvents();
 
-   glfwPollEvents();
+   if (glfwWindowShouldClose(window)) {
+      UIEvent e;
+      e.type = UI_EVENT_QUIT;
+
+      s_events.push(e);
+   }
 }
 
-unsigned char GameGui_GLFW::getKeyEvent(unsigned int key) {
-   return s_keyState[key];
-}
-
-bool GameGui_GLFW::isKeyPressed(unsigned int key) {
-   return s_keyDown[key];
-}
-
-int GameGui_GLFW::pollMouseEvent(MouseEvent* event) {
-   if (mouseEvents.empty()) {
+int GameGui_GLFW::pollEvent(UIEvent* event) {
+   if (s_events.empty()) {
       return 0;
    }
 
-   *event = mouseEvents.front();
-   mouseEvents.pop();
+   *event = s_events.front();
+   s_events.pop();
 
    return 1;
 }
-*/
 
 #ifdef GAMEGUI_INCLUDE_VULKAN
@@ -149,20 +133,8 @@
 
 void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
-   GameGui_GLFW::s_keyState[key] = action;
-   /*
-   switch(action) {
-      case GLFW_PRESS:
-         s_keyState[key] = RTWO_KEY_EVENT_PRESSED;
-         break;
-      case GLFW_RELEASE:
-         s_keyState[key] = RTWO_KEY_EVENT_RELEASED;
-         break;
-      default:
-         s_keyState[key] = RTWO_KEY_EVENT_NONE;
-         break;
-   }
+   UIEvent e;
+   e.type = UI_EVENT_KEY;
+   e.key.keycode = key;
 
-   // should be true for GLFW_PRESS and GLFW_REPEAT
-   GameGui_GLFW::s_keyDown[key] = (action != GLFW_RELEASE);
-   */
+   GameGui_GLFW::s_events.push(e);
 }
Index: game-gui-glfw.hpp
===================================================================
--- game-gui-glfw.hpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ game-gui-glfw.hpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -1,4 +1,6 @@
 #ifndef _GAME_GUI_GLFW_H
 #define _GAME_GUI_GLFW_H
+
+#include <queue>
 
 #include "game-gui.hpp"
@@ -14,8 +16,6 @@
       static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
 
-      // Both have to be public so that glfw_key_callback can access them
-      // TODO: Implement a more generic public api over this to get the key state
-      static int s_keyState[GLFW_KEY_LAST];
-      static bool s_keyDown[GLFW_KEY_LAST];
+      // Has to be public so that glfw_key_callback can access it
+      static queue<UIEvent> s_events;
 
       string& getError();
@@ -27,12 +27,6 @@
       void destroyWindow();
 
-      /*
       void processEvents();
-
-      unsigned char getKeyEvent(unsigned int key);
-      bool isKeyPressed(unsigned int key);
-
-      int pollMouseEvent(MouseEvent* event);
-      */
+      int pollEvent(UIEvent* event);
 
 #ifdef GAMEGUI_INCLUDE_VULKAN
@@ -47,5 +41,4 @@
 
       int windowWidth, windowHeight;
-      static queue<UIEvent> s_events;
 };
 
Index: game-gui-sdl.cpp
===================================================================
--- game-gui-sdl.cpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ game-gui-sdl.cpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -7,12 +7,4 @@
 
 using namespace std;
-
-/*
-// Temporary to allow the program using this class to receive events other than keyboard events
-// Remove once I add a better game-gui wrapper for doing that
-queue<SDL_Event> events;
-
-queue<MouseEvent> mouseEvents;
-*/
 
 string GameGui_SDL::s_errorMessage;
@@ -116,4 +108,5 @@
          case SDL_AUDIODEVICEADDED:
          case SDL_AUDIODEVICEREMOVED:
+         case SDL_TEXTEDITING: // TODO: Research this one later
             event = nullptr;
             return 0;
Index: game-gui-sdl.hpp
===================================================================
--- game-gui-sdl.hpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ game-gui-sdl.hpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -22,16 +22,4 @@
       int pollEvent(UIEvent* event);
 
-      // temporary
-      //int pollEvent(SDL_Event* event);
-
-      /*
-      void processEvents();
-
-      unsigned char getKeyEvent(unsigned int key);
-      bool isKeyPressed(unsigned int key);
-
-      int pollMouseEvent(MouseEvent* event);
-      */
-
 #ifdef GAMEGUI_INCLUDE_VULKAN
       bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
Index: opengl-game.cpp
===================================================================
--- opengl-game.cpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ opengl-game.cpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -57,23 +57,26 @@
 
 void OpenGLGame::mainLoop() {
-   //MouseEvent e;
+   UIEvent e;
+   bool quit = false;
 
-   while (!glfwWindowShouldClose(window)) {
-      /*
+   while (!quit) {
       gui->processEvents();
 
-      if (gui->getKeyEvent(GLFW_KEY_ESCAPE) == RTWO_KEY_EVENT_PRESSED) {
-         glfwSetWindowShouldClose(window, 1);
-      }
-
-      while (gui->pollMouseEvent(&e)) {
-         cout << "Mouse click detected at (" << e.x << ", " << e.y << ")" << endl;
-      }
-      */
-
-      glfwPollEvents();
-
-      if (GameGui_GLFW::s_keyState[GLFW_KEY_ESCAPE] == GLFW_PRESS) {
-         glfwSetWindowShouldClose(window, 1);
+      while (gui->pollEvent(&e)) {
+         switch (e.type) {
+            case UI_EVENT_QUIT:
+               cout << "Quit event detected" << endl;
+               quit = true;
+               break;
+            case UI_EVENT_KEY:
+               if (e.key.keycode == GLFW_KEY_ESCAPE) {
+                  quit = true;
+               } else {
+                  cout << "Key event detected" << endl;
+               }
+               break;
+            default:
+               cout << "Unhandled UI event: " << e.type << endl;
+         }
       }
 
Index: vulkan-game.cpp
===================================================================
--- vulkan-game.cpp	(revision f6521fb45b951dc6898451d050a9e418cba295e2)
+++ vulkan-game.cpp	(revision c61323ad47d109393de51910f8bc9c0f688c8fab)
@@ -92,4 +92,6 @@
             case UI_EVENT_MOUSEMOTION:
                break;
+            default:
+               cout << "Unhandled UI event: " << e.type << endl;
          }
       }
