fixed up the key mapping system a little ... still does comparisons wrong ...
[physics.git] / src / config / keys.h
index 9244a6f..49fe66f 100644 (file)
 
 #include <SDL/SDL.h>
 
+#include <map>
+#include <string>
+
+#include "../debug.h"
+
+class comparestrings
+{
+  public:
+    bool operator()
+    (
+        const std::string& a,
+        const std::string& b
+    )
+    {
+        cout << a << endl;
+        cout << b << endl;
+        cout << endl;
+
+        return a.compare(b) < 0;
+    }
+};
+
 /// ***** Header Methods *****
 namespace key
 {
-    void init();
-    void clean();
+    extern SDLKey pause;
+    extern SDLKey end;
+    extern SDLKey follow;
+    extern SDLKey well;
+
+    typedef std::map<std::string, SDLKey*, comparestrings> inputMap;
 
-    static SDLKey pause;
-    static SDLKey end;
-    static SDLKey follow;
-    static SDLKey well;
+    extern inputMap sdlMap;
+
+    void init();
 }
 
 #endif // KEYS_H