I was taught const int, and when I looked it up that's how other people defined it. Sorry if I made you mad
No maddening was done ;o
FWIW, I had the same issue when trying to add a controller mapping class to my game engine (which backends into SDL). Upon spending numerous hours trying to wrap SDL's already well-wrapped event pump functionality, I decided that trying to wrap SDL was pretty silly and not very fruitful, so I just exposed it. I figure SDL has already encapsulated things about as well as I could hope to anyway, and putting any kind of wrapper around SDL's functionality, when not 100% necessary, would only serve to muddle my API.
Your mileage may vary.
Yes, I am more inclined towards not making my own names for SDLK's, after reading apatriarca's post. I will not be exposing SDL either though.
...What you could do is grab a copy of SDL_keysym.h and use your text editor's find and replace "SDLK" with "const int KEY" then replace "," with ";" and copy and paste the resulting modified lines into your .c file.
Ohhh.... copying directly from SDL headers, I didn't think of that, even though it's so simple.
Rough draft of what I have in mind now is this, after reading apatriarca's post:
extern int KEY_PICKUP;
extern int KEY_LEFT;
extern int KEY_RIGHT;
if(SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_EVENTTHREAD) != 0) return 1;
KEY_PICKUP = file_get_int("config", KEY_PICKUP);
KEY_LEFT = file_get_int("config", KEY_LEFT);
KEY_RIGHT = file_get_int("config", KEY_RIGHT);
char get_key_state(int key)
This feels all right with me, because it hides SDL pretty well, and it actually hides the keyboard pretty well too. What does everyone think?