Hello.
I am having a very strange issue that has me puzzled. I’ve built a rotating
carousel that is controlled with the z and x keys.
case SDLK_z:
rotator->direction = ROTATOR_DIRECTION_PREVIOUS;
Rotator_MoveRotator(rotator, 1);
break;
case SDLK_x:
rotator->direction = ROTATOR_DIRECTION_NEXT;
Rotator_MoveRotator(rotator, 1);
break;
When I launch my app and press and hold z, I get a reasonable amount of
KEYDOWN events.
If I then press and hold x, I get a massive amount of KEYDOWN events
causing the carousel to go crazy.
I’ve spent several hours debugging trying to rule out a coding error.
For the heck of it, I decided to switch SDLK_x to SDLK_SLASH. The carousel
then works properly every time.
I decided to play around some more, and noticed a pattern. If I launch the
app, press and hold x, I get a tremendous amount of KEYDOWN events. If I
then switch focus to another window, and then return back to the app
window, and press and hold x, I start getting a reasonable amount of
KEYDOWN events.
Has anyone ever seen this behavior before or am I crazy?
I’m using SDL 2 in OS X 10.8.
Thanks,
– Jason