#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
{
extern SDLKey follow;
extern SDLKey well;
- typedef std::map<std::string, SDLKey*, comparestrings> inputMap;
+ typedef std::map<std::string, SDLKey*> inputMap;
extern inputMap sdlMap;
using std::ifstream;
using std::string;
-typedef std::map<string, SDLKey, comparestrings> kMap;
+typedef std::map<string, SDLKey> kMap;
kMap keyMap;
/// ***** Private Method Headers *****
void createKeyMap()
{
+ char buf[2] = {0,0};
+
// add all the letters
for (int i = 'A'; i <= 'Z'; i++) // uppercase
- keyMap["" + (char)i] = (SDLKey)i;
+ {
+ buf[0] = (char)i;
+ keyMap[buf] = (SDLKey)i;
+ }
for (int i = 'a'; i <= 'z'; i++) // lowercase
- keyMap["" + (char)i] = (SDLKey)i;
+ {
+ buf[0] = (char)i;
+ keyMap[buf] = (SDLKey)i;
+ }
// add all the numbers
for (int i = '0'; i <= '9'; i++)
- keyMap["" + (char)i] = (SDLKey)i;
-
- keyMap["k"] = (SDLKey)'k';
+ {
+ buf[0] = (char)i;
+ keyMap[buf] = (SDLKey)i;
+ }
/*
// add the function keys
keyMap["Down"] = SDLK_DOWN;
keyMap["Left"] = SDLK_LEFT;
keyMap["Right"] = SDLK_RIGHT;
-
- cout << "done" << endl;
- cout << keyMap["k"] << endl;
}