SDL (1.2.13, Windows XP) has no reliable way of detecting ctrl-click
combinations.
SDL_GetModState doesn’t work because it doesn’t report the modifier
state at the time of the event. Consider this sequence:
User pressed ctrl.
User clicks mouse button.
User releases ctrl.
Application handles the click event, but doesn’t see that ctrl was
pressed at the time of the click.
Remembering the modifier state from the last SDL_KEYDOWN or SDL_KEYUP
event works better, but requires careful handling of SDL_KEYUP events.
There are two possible solutions to this problem.
Add a ‘mod’ member to all mouse events. Unfortunately this may
break backwards compatibility.
Modify SDL_GetModState to reliably return the modifier state at the
time of the last event that has been passed to the application.–
Rainer Deyke - rainerd at eldwood.com
SDL (1.2.13, Windows XP) has no reliable way of detecting ctrl-click
combinations.
SDL_GetModState doesn’t work because it doesn’t report the modifier
state at the time of the event. Consider this sequence:
User pressed ctrl.
User clicks mouse button.
User releases ctrl.
Application handles the click event, but doesn’t see that ctrl was
pressed at the time of the click.
Remembering the modifier state from the last SDL_KEYDOWN or SDL_KEYUP
event works better, but requires careful handling of SDL_KEYUP events.
There are two possible solutions to this problem.
Add a ‘mod’ member to all mouse events. Unfortunately this may
break backwards compatibility.
Modify SDL_GetModState to reliably return the modifier state at the
time of the last event that has been passed to the application.
I’d vote for #1. It’s simpler and the events struct has already been changed
in 1.3, so this is a pretty good place to add it in.>----- Original Message ----