I think I've narrowed down the problem.
When testing the remote with the piece of code below, I can make the "bug" stop by increasing the interval's value given while calling SDL_EnableKeyRepeat. A value of 500 gives good result; while the value chosen in XBMC 11.0 (10ms) gives problems of too many repeats.
Where shall I open a bug report, XBMC or SDL ?
Thx
--
Issa
Code:
#include <SDL/SDL.h>
main(int argc, char *argv[])
{
int quit = 0;
int count = 0;
SDL_Event event;
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
exit(1);
}
if (!SDL_SetVideoMode(320, 200, 0, 0)) {
fprintf(stderr, "Could not set video mode: %s\n", SDL_GetError());
SDL_Quit();
exit(1);
}
atexit(SDL_Quit);
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 500);
while (!quit) {
/* if (SDL_WaitEvent(&event) < 1) {
fprintf(stderr, "WaitEvent error: %s\n", SDL_GetError());
exit(1);
}
*/
if (SDL_PollEvent(&event) < 1) {
continue;
}
switch (event.type) {
case SDL_KEYDOWN:
printf("Key pressed:\n");
printf(" state: %i\n", event.key.state);
printf(" SDL sim: %i\n", event.key.keysym.sym);
printf(" modifiers: %i\n", event.key.keysym.mod);
printf(" unicode: %i (if enabled with SDL_EnableUNICODE)\n", event.key.keysym.unicode);
break;
case SDL_KEYUP:
printf("Key released:\n");
printf(" state: %i\n", event.key.state);
printf(" SDL sim: %i\n", event.key.keysym.sym);
printf(" modifiers: %i\n", event.key.keysym.mod);
printf(" unicode: %i (if enabled with SDL_EnableUNICODE)\n", event.key.keysym.unicode);
break;
case SDL_QUIT:
printf("Request to quit\n");
quit = 1;
break;
case SDL_USEREVENT:
printf("User event:\n");
printf(" code: %i\n", event.user.code);
printf(" data1: %p\n", event.user.data1);
printf(" data2: %p\n", event.user.data2);
break;
}
printf("%i\n", ++count);
}
}

Search
Help