fix incorrect assumption, minor refactoring
[sdl_omap.git] / docs / html / sdlmousebuttonevent.html
... / ...
CommitLineData
1<HTML
2><HEAD
3><TITLE
4>SDL_MouseButtonEvent</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
8"><LINK
9REL="HOME"
10TITLE="SDL Library Documentation"
11HREF="index.html"><LINK
12REL="UP"
13TITLE="SDL Event Structures."
14HREF="eventstructures.html"><LINK
15REL="PREVIOUS"
16TITLE="SDL_MouseMotionEvent"
17HREF="sdlmousemotionevent.html"><LINK
18REL="NEXT"
19TITLE="SDL_JoyAxisEvent"
20HREF="sdljoyaxisevent.html"></HEAD
21><BODY
22CLASS="REFENTRY"
23BGCOLOR="#FFF8DC"
24TEXT="#000000"
25LINK="#0000ee"
26VLINK="#551a8b"
27ALINK="#ff0000"
28><DIV
29CLASS="NAVHEADER"
30><TABLE
31SUMMARY="Header navigation table"
32WIDTH="100%"
33BORDER="0"
34CELLPADDING="0"
35CELLSPACING="0"
36><TR
37><TH
38COLSPAN="3"
39ALIGN="center"
40>SDL Library Documentation</TH
41></TR
42><TR
43><TD
44WIDTH="10%"
45ALIGN="left"
46VALIGN="bottom"
47><A
48HREF="sdlmousemotionevent.html"
49ACCESSKEY="P"
50>Prev</A
51></TD
52><TD
53WIDTH="80%"
54ALIGN="center"
55VALIGN="bottom"
56></TD
57><TD
58WIDTH="10%"
59ALIGN="right"
60VALIGN="bottom"
61><A
62HREF="sdljoyaxisevent.html"
63ACCESSKEY="N"
64>Next</A
65></TD
66></TR
67></TABLE
68><HR
69ALIGN="LEFT"
70WIDTH="100%"></DIV
71><H1
72><A
73NAME="SDLMOUSEBUTTONEVENT"
74></A
75>SDL_MouseButtonEvent</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN4144"
80></A
81><H2
82>Name</H2
83>SDL_MouseButtonEvent&nbsp;--&nbsp;Mouse button event structure</DIV
84><DIV
85CLASS="REFSECT1"
86><A
87NAME="AEN4147"
88></A
89><H2
90>Structure Definition</H2
91><PRE
92CLASS="PROGRAMLISTING"
93>typedef struct{
94 Uint8 type;
95 Uint8 button;
96 Uint8 state;
97 Uint16 x, y;
98} SDL_MouseButtonEvent;</PRE
99></DIV
100><DIV
101CLASS="REFSECT1"
102><A
103NAME="AEN4150"
104></A
105><H2
106>Structure Data</H2
107><DIV
108CLASS="INFORMALTABLE"
109><A
110NAME="AEN4152"
111></A
112><P
113></P
114><TABLE
115BORDER="0"
116CLASS="CALSTABLE"
117><TBODY
118><TR
119><TD
120ALIGN="LEFT"
121VALIGN="TOP"
122><TT
123CLASS="STRUCTFIELD"
124><I
125>type</I
126></TT
127></TD
128><TD
129ALIGN="LEFT"
130VALIGN="TOP"
131><TT
132CLASS="LITERAL"
133>SDL_MOUSEBUTTONDOWN</TT
134> or <TT
135CLASS="LITERAL"
136>SDL_MOUSEBUTTONUP</TT
137></TD
138></TR
139><TR
140><TD
141ALIGN="LEFT"
142VALIGN="TOP"
143><TT
144CLASS="STRUCTFIELD"
145><I
146>button</I
147></TT
148></TD
149><TD
150ALIGN="LEFT"
151VALIGN="TOP"
152>The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)</TD
153></TR
154><TR
155><TD
156ALIGN="LEFT"
157VALIGN="TOP"
158><TT
159CLASS="STRUCTFIELD"
160><I
161>state</I
162></TT
163></TD
164><TD
165ALIGN="LEFT"
166VALIGN="TOP"
167><TT
168CLASS="LITERAL"
169>SDL_PRESSED</TT
170> or <TT
171CLASS="LITERAL"
172>SDL_RELEASED</TT
173></TD
174></TR
175><TR
176><TD
177ALIGN="LEFT"
178VALIGN="TOP"
179><TT
180CLASS="STRUCTFIELD"
181><I
182>x</I
183></TT
184>, <TT
185CLASS="STRUCTFIELD"
186><I
187>y</I
188></TT
189></TD
190><TD
191ALIGN="LEFT"
192VALIGN="TOP"
193>The X/Y coordinates of the mouse at press/release time</TD
194></TR
195></TBODY
196></TABLE
197><P
198></P
199></DIV
200></DIV
201><DIV
202CLASS="REFSECT1"
203><A
204NAME="AEN4176"
205></A
206><H2
207>Description</H2
208><P
209><SPAN
210CLASS="STRUCTNAME"
211>SDL_MouseButtonEvent</SPAN
212> is a member of the <A
213HREF="sdlevent.html"
214><SPAN
215CLASS="STRUCTNAME"
216>SDL_Event</SPAN
217></A
218> union and is used when an event of type <TT
219CLASS="LITERAL"
220>SDL_MOUSEBUTTONDOWN</TT
221> or <TT
222CLASS="LITERAL"
223>SDL_MOUSEBUTTONUP</TT
224> is reported.</P
225><P
226>When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into <TT
227CLASS="STRUCTFIELD"
228><I
229>button</I
230></TT
231>, the position of the mouse when this event occured is stored in the <TT
232CLASS="STRUCTFIELD"
233><I
234>x</I
235></TT
236> and the <TT
237CLASS="STRUCTFIELD"
238><I
239>y</I
240></TT
241> fields. Like <A
242HREF="sdlkeyboardevent.html"
243><SPAN
244CLASS="STRUCTNAME"
245>SDL_KeyboardEvent</SPAN
246></A
247>, information on whether the event was a press or a release event is stored in both the <TT
248CLASS="STRUCTFIELD"
249><I
250>type</I
251></TT
252> and <TT
253CLASS="STRUCTFIELD"
254><I
255>state</I
256></TT
257> fields, but this should be obvious.</P
258></DIV
259><DIV
260CLASS="REFSECT1"
261><A
262NAME="AEN4192"
263></A
264><H2
265>See Also</H2
266><P
267><A
268HREF="sdlevent.html"
269><SPAN
270CLASS="STRUCTNAME"
271>SDL_Event</SPAN
272></A
273>,
274<A
275HREF="sdlmousemotionevent.html"
276><SPAN
277CLASS="STRUCTNAME"
278>SDL_MouseMotionEvent</SPAN
279></A
280></P
281></DIV
282><DIV
283CLASS="NAVFOOTER"
284><HR
285ALIGN="LEFT"
286WIDTH="100%"><TABLE
287SUMMARY="Footer navigation table"
288WIDTH="100%"
289BORDER="0"
290CELLPADDING="0"
291CELLSPACING="0"
292><TR
293><TD
294WIDTH="33%"
295ALIGN="left"
296VALIGN="top"
297><A
298HREF="sdlmousemotionevent.html"
299ACCESSKEY="P"
300>Prev</A
301></TD
302><TD
303WIDTH="34%"
304ALIGN="center"
305VALIGN="top"
306><A
307HREF="index.html"
308ACCESSKEY="H"
309>Home</A
310></TD
311><TD
312WIDTH="33%"
313ALIGN="right"
314VALIGN="top"
315><A
316HREF="sdljoyaxisevent.html"
317ACCESSKEY="N"
318>Next</A
319></TD
320></TR
321><TR
322><TD
323WIDTH="33%"
324ALIGN="left"
325VALIGN="top"
326>SDL_MouseMotionEvent</TD
327><TD
328WIDTH="34%"
329ALIGN="center"
330VALIGN="top"
331><A
332HREF="eventstructures.html"
333ACCESSKEY="U"
334>Up</A
335></TD
336><TD
337WIDTH="33%"
338ALIGN="right"
339VALIGN="top"
340>SDL_JoyAxisEvent</TD
341></TR
342></TABLE
343></DIV
344></BODY
345></HTML
346>