I'm having a curious little problem polling mouse events using SDL.
if(event.type == SDL_MOUSEBUTTONDOWN) {
printf("click %d\n", event.button.button);
}
else if(event.type == SDL_MOUSEMOTION) {
printf("move %d\n", event.button.button);
}
If I click and hold the right mouse button while moving the mouse I get:
click 3 // = SDL_BUTTON_RIGHT
move 4 // != SDL_BUTTON_RIGHT !
move 4
...
i.e. SDL_MOUSEBUTTONDOWN is setting button.button to 3 for right mouse button while SDL_MOUSEMOTION is setting it to 4.
Does anyone know why this might be happening?