src/Input.hh
changeset 235 0a0c729365ee
parent 233 ff4ecea83cf5
child 237 3d5465bcb67d
--- a/src/Input.hh	Sat Dec 06 22:51:51 2008 +0000
+++ b/src/Input.hh	Sat Dec 06 23:29:06 2008 +0000
@@ -35,10 +35,25 @@
 typedef uint16_t PlayerInput;
 typedef uint16_t GuiInput;
 
-/*
- * Handle keycodes
- */
-PlayerInput handlePlayerInput (CL_InputDevice &keyboard);
-GuiInput handleGuiInput (CL_InputDevice &keyboard);
+template <typename BitEnumType> struct InputKeymapEntry;
+
+class Input {
+    protected:
+        CL_InputDevice &keyboard;
+
+    public:
+        Input (CL_InputDevice &keyboard);
+    
+    private:
+        bool checkKeycode (int keycode);
+        template <typename BitEnumType, typename BitMaskType> BitMaskType buildMask (InputKeymapEntry<BitEnumType> *keymap);
+
+    public:
+        /*
+         * Reads the keyboard to determine current state of the Player/Gui input
+         */
+        PlayerInput readPlayerInput (void);
+        GuiInput readGuiInput (void);
+};
 
 #endif