Mouse Events
The mouse events—mouse motion and mouse button each have their own structures for dealing with the events.
Mouse Motion Events
A mouse motion event is stored in an SDL_MouseMotionEvent, which looks like this.
typedef struct{
Uint8 type;
Uint8 state;
Uint16 x, y;
Sint16 xrel, yrel;
} SDL_MouseMotionEvent;
As with all SDL event structures, the type member specifies what type of event has occurred. In the case of a mouse motion event, this constant will only ever be SDL_MOUSEMOTION.
The state member is a combination of bit flags that tells you which mouse buttons are currently pressed, if any. Table below shows these bit flags.