Mouse scroll wheel scrolling is not working while the shift key is
held down. This must be some sort of bug because the exact same code
produces different results on windows than it does on a mac. Command,
Control, and Alt all work fine, but the shift key disables scrolling.
I believe it worked in older versions of SDL (prior to 1.2.13). I
thought I might have been doing something wrong with my program, so I
tried using one of the sample SDL programs linked to from the SDL
tutorials page, SDL and SDL and OpenGL(http://www.meandmark.com/sdlopenglpart1.html
).
I just modified the EventLoop function.
void GameApp::EventLoop(void)
{
SDL_Event event;
while((!done) && (SDL_WaitEvent(&event)))
{
switch(event.type)
{
case SDL_USEREVENT:
HandleUserEvents(&event);
break;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
// Scroll doesn’t register while shift key is held down.
if(event.button.button == SDL_BUTTON_WHEELDOWN)
printf(“SDL_BUTTON_WHEELDOWN\n”);
else if(event.button.button == SDL_BUTTON_WHEELUP)
printf(“SDL_BUTTON_WHEELUP\n”);
break;
case SDL_KEYDOWN:
if(event.key.keysym.sym==SDLK_v)
{
const SDL_version * v = SDL_Linked_Version();// I am using 1.2.13
printf(“Version: %u.%u.%u\n”, v->major, v->minor, v->patch);
}
else if(event.key.keysym.sym==SDLK_LSHIFT)
printf(“You are holding the SDLK_LSHIFT key down. Scrolling is
ignored!\n”);
break;
case SDL_KEYUP:
if(event.key.keysym.sym==SDLK_LSHIFT)
printf(“You released the SDLK_LSHIFT key. Scrolling will work
again.\n”);
break;
case SDL_QUIT:
done = true;
break;
default:
break;
} // End switch
} // End while
}
Does anyone know why this might be occurring?
-Trevor Agnitti
www.lackeyccg.com