--- 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