I have my small project in which I use SDL, and I played with various available drivers. I came across the aalib driver, and I realized that the SDL_KEYUP event was never raised.
This, however, only occurs under certain conditions. The event is dispatched when using the X-driver, but not when used in console mode (for example, using Ctrl + Alt + F1).
Here is the minimal code to verify this:
#include <SDL/SDL.h> #include <stdio.h> int main() { SDL_Init(0); SDL_SetVideoMode(64, 64, 32, SDL_SWSURFACE); while(1) { SDL_Event event; while(SDL_PollEvent(&event)) { if(event.type == SDL_KEYDOWN) printf("Key down: %d\n", event.key.keysym.sym); else if(event.type == SDL_KEYUP) printf("Key up: %d\n", event.key.keysym.sym); else if(event.type == SDL_QUIT) SDL_Quit(); } } }
Then, to run it using aalib:
env SDL_VIDEODRIVER=aalib ./a.out
My question is: is this considered a mistake? Or is this something aalib cannot know because the console will not give this information?
If aalib cannot get this information, I feel ashamed that the SDL cannot provide the same functions for all drivers.
OS: FreeBSD 8.2
SDL Version: 1.2.14
source share