1SDL_MouseButtonEvent(3)        SDL API Reference       SDL_MouseButtonEvent(3)
2
3
4

NAME

6       SDL_MouseButtonEvent - Mouse button event structure
7

STRUCTURE DEFINITION

9       typedef struct{
10         Uint8 type;
11         Uint8 button;
12         Uint8 state;
13         Uint16 x, y;
14       } SDL_MouseButtonEvent;
15

STRUCTURE DATA

17       type                SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
18
19       button              The  mouse  button index (SDL_BUTTON_LEFT, SDL_BUT‐
20                           TON_MIDDLE, SDL_BUTTON_RIGHT)
21
22       state               SDL_PRESSED or SDL_RELEASED
23
24       x, y                The X/Y coordinates of the mouse  at  press/release
25                           time
26

DESCRIPTION

28       SDL_MouseButtonEvent  is  a  member  of the SDL_Event union and is used
29       when an event  of  type  SDL_MOUSEBUTTONDOWN  or  SDL_MOUSEBUTTONUP  is
30       reported.
31
32       When  a  mouse  button  press or release is detected then number of the
33       button pressed (from 1 to 255, with 1 usually being the left button and
34       2 the right) is placed into button, the position of the mouse when this
35       event occured is stored in the x and the y fields. Like  SDL_KeyboardE‐
36       vent,  information  on whether the event was a press or a release event
37       is stored in both the type and state fields, but this should  be  obvi‐
38       ous.
39

SEE ALSO

41       SDL_Event, SDL_MouseMotionEvent
42
43
44
45SDL                         Tue 11 Sep 2001, 22:59     SDL_MouseButtonEvent(3)
Impressum