SDL-1.2.14
[sdl_omap.git] / docs / html / sdlmousemotionevent.html
CommitLineData
e14743d1 1<HTML
2><HEAD
3><TITLE
4>SDL_MouseMotionEvent</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_KeyboardEvent"
17HREF="sdlkeyboardevent.html"><LINK
18REL="NEXT"
19TITLE="SDL_MouseButtonEvent"
20HREF="sdlmousebuttonevent.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="sdlkeyboardevent.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="sdlmousebuttonevent.html"
63ACCESSKEY="N"
64>Next</A
65></TD
66></TR
67></TABLE
68><HR
69ALIGN="LEFT"
70WIDTH="100%"></DIV
71><H1
72><A
73NAME="SDLMOUSEMOTIONEVENT"
74></A
75>SDL_MouseMotionEvent</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN4079"
80></A
81><H2
82>Name</H2
83>SDL_MouseMotionEvent&nbsp;--&nbsp;Mouse motion event structure</DIV
84><DIV
85CLASS="REFSECT1"
86><A
87NAME="AEN4082"
88></A
89><H2
90>Structure Definition</H2
91><PRE
92CLASS="PROGRAMLISTING"
93>typedef struct{
94 Uint8 type;
95 Uint8 state;
96 Uint16 x, y;
97 Sint16 xrel, yrel;
98} SDL_MouseMotionEvent;</PRE
99></DIV
100><DIV
101CLASS="REFSECT1"
102><A
103NAME="AEN4085"
104></A
105><H2
106>Structure Data</H2
107><DIV
108CLASS="INFORMALTABLE"
109><A
110NAME="AEN4087"
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_MOUSEMOTION</TT
134></TD
135></TR
136><TR
137><TD
138ALIGN="LEFT"
139VALIGN="TOP"
140><TT
141CLASS="STRUCTFIELD"
142><I
143>state</I
144></TT
145></TD
146><TD
147ALIGN="LEFT"
148VALIGN="TOP"
149>The current button state</TD
150></TR
151><TR
152><TD
153ALIGN="LEFT"
154VALIGN="TOP"
155><TT
156CLASS="STRUCTFIELD"
157><I
158>x</I
159></TT
160>, <TT
161CLASS="STRUCTFIELD"
162><I
163>y</I
164></TT
165></TD
166><TD
167ALIGN="LEFT"
168VALIGN="TOP"
169>The X/Y coordinates of the mouse</TD
170></TR
171><TR
172><TD
173ALIGN="LEFT"
174VALIGN="TOP"
175><TT
176CLASS="STRUCTFIELD"
177><I
178>xrel</I
179></TT
180>, <TT
181CLASS="STRUCTFIELD"
182><I
183>yrel</I
184></TT
185></TD
186><TD
187ALIGN="LEFT"
188VALIGN="TOP"
189>Relative motion in the X/Y direction</TD
190></TR
191></TBODY
192></TABLE
193><P
194></P
195></DIV
196></DIV
197><DIV
198CLASS="REFSECT1"
199><A
200NAME="AEN4109"
201></A
202><H2
203>Description</H2
204><P
205><SPAN
206CLASS="STRUCTNAME"
207>SDL_MouseMotionEvent</SPAN
208> is a member of the <A
209HREF="sdlevent.html"
210><SPAN
211CLASS="STRUCTNAME"
212>SDL_Event</SPAN
213></A
214> union and is used when an event of type <TT
215CLASS="LITERAL"
216>SDL_MOUSEMOTION</TT
217> is reported.</P
218><P
219>Simply put, a <TT
220CLASS="LITERAL"
221>SDL_MOUSEMOTION</TT
222> type event occurs when a user moves the mouse within the application window or when <A
223HREF="sdlwarpmouse.html"
224><TT
225CLASS="FUNCTION"
226>SDL_WarpMouse</TT
227></A
228> is called. Both the absolute (<TT
229CLASS="STRUCTFIELD"
230><I
231>x</I
232></TT
233> and <TT
234CLASS="STRUCTFIELD"
235><I
236>y</I
237></TT
238>) and relative (<TT
239CLASS="STRUCTFIELD"
240><I
241>xrel</I
242></TT
243> and <TT
244CLASS="STRUCTFIELD"
245><I
246>yrel</I
247></TT
248>) coordinates are reported along with the current button states (<TT
249CLASS="STRUCTFIELD"
250><I
251>state</I
252></TT
253>). The button state can be interpreted using the <TT
254CLASS="LITERAL"
255>SDL_BUTTON</TT
256> macro (see <A
257HREF="sdlgetmousestate.html"
258><TT
259CLASS="FUNCTION"
260>SDL_GetMouseState</TT
261></A
262>).</P
263><P
264>If the cursor is hidden (<A
265HREF="sdlshowcursor.html"
266><TT
267CLASS="FUNCTION"
268>SDL_ShowCursor</TT
269>(0)</A
270>) and the input is grabbed (<A
271HREF="sdlwmgrabinput.html"
272><TT
273CLASS="FUNCTION"
274>SDL_WM_GrabInput</TT
275>(SDL_GRAB_ON)</A
276>), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.</P
277></DIV
278><DIV
279CLASS="REFSECT1"
280><A
281NAME="AEN4133"
282></A
283><H2
284>See Also</H2
285><P
286><A
287HREF="sdlevent.html"
288><SPAN
289CLASS="STRUCTNAME"
290>SDL_Event</SPAN
291></A
292>,
293<A
294HREF="sdlmousebuttonevent.html"
295><SPAN
296CLASS="STRUCTNAME"
297>SDL_MouseButtonEvent</SPAN
298></A
299></P
300></DIV
301><DIV
302CLASS="NAVFOOTER"
303><HR
304ALIGN="LEFT"
305WIDTH="100%"><TABLE
306SUMMARY="Footer navigation table"
307WIDTH="100%"
308BORDER="0"
309CELLPADDING="0"
310CELLSPACING="0"
311><TR
312><TD
313WIDTH="33%"
314ALIGN="left"
315VALIGN="top"
316><A
317HREF="sdlkeyboardevent.html"
318ACCESSKEY="P"
319>Prev</A
320></TD
321><TD
322WIDTH="34%"
323ALIGN="center"
324VALIGN="top"
325><A
326HREF="index.html"
327ACCESSKEY="H"
328>Home</A
329></TD
330><TD
331WIDTH="33%"
332ALIGN="right"
333VALIGN="top"
334><A
335HREF="sdlmousebuttonevent.html"
336ACCESSKEY="N"
337>Next</A
338></TD
339></TR
340><TR
341><TD
342WIDTH="33%"
343ALIGN="left"
344VALIGN="top"
345>SDL_KeyboardEvent</TD
346><TD
347WIDTH="34%"
348ALIGN="center"
349VALIGN="top"
350><A
351HREF="eventstructures.html"
352ACCESSKEY="U"
353>Up</A
354></TD
355><TD
356WIDTH="33%"
357ALIGN="right"
358VALIGN="top"
359>SDL_MouseButtonEvent</TD
360></TR
361></TABLE
362></DIV
363></BODY
364></HTML
365>