Upon discovering that SDL and X11 use the same keyboard key IDs (I think they’re called keysyms), I wanted to use these codes. However, I don’t know them and I don’t want to just use their defines as I don’t want to include stuff as I’m writing a library and don’t want to rely on either X11 or SDL as I may just be using X11 or just SDL. Is there a list of keyboard codes like 0x200 or something?
Let me try to explain a bit better, I’m using SDL and X11 as libraries to make input, but I want my application to have its own key defines to abstract SDL, X11 and Win32 keys.
It is not wise to use the codes directly because these might change anytime (unlike their defines). And exploiting the fact that SDL uses the same codes as X11 doesn’t sound well. Better approach would be to create bridge headers for both X11 and SDL that would look like this:
Then just conditionally include the corresponding header.
In case I didn’t convince you, you can find the corresponding defines in SDL.h header.