1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreMouseEvent.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
10 | <h1>OgreMouseEvent.h</h1><a href="OgreMouseEvent_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
15 | 00006 <span class="comment"></span> |
---|
16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
18 | 00009 <span class="comment"></span> |
---|
19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
20 | 00011 <span class="comment">the terms of the GNU Lesser General License as published by the Free Software</span> |
---|
21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
22 | 00013 <span class="comment">version.</span> |
---|
23 | 00014 <span class="comment"></span> |
---|
24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General License for more details.</span> |
---|
27 | 00018 <span class="comment"></span> |
---|
28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General License along with</span> |
---|
29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
33 | 00024 <span class="comment">*/</span> |
---|
34 | 00025 <span class="comment">/***************************************************************************</span> |
---|
35 | 00026 <span class="comment">OgreMouseEvent.h - </span> |
---|
36 | 00027 <span class="comment"> * An event which indicates that a mouse action occurred in a MouseTarget (e.g. MouseTarget).</span> |
---|
37 | 00028 <span class="comment"> * This event is used both for mouse events (click, enter, exit) and mouse </span> |
---|
38 | 00029 <span class="comment"> * motion events (moves and drags). </span> |
---|
39 | 00030 <span class="comment"> * <P></span> |
---|
40 | 00031 <span class="comment"> * This low-level event is generated by a MouseTarget object for:</span> |
---|
41 | 00032 <span class="comment"> * <ul></span> |
---|
42 | 00033 <span class="comment"> * <li>Mouse Events</span> |
---|
43 | 00034 <span class="comment"> * <ul></span> |
---|
44 | 00035 <span class="comment"> * <li>a mouse button is pressed</span> |
---|
45 | 00036 <span class="comment"> * <li>a mouse button is released</span> |
---|
46 | 00037 <span class="comment"> * <li>a mouse button is clicked (pressed and released)</span> |
---|
47 | 00038 <span class="comment"> * <li>the mouse cursor enters a MouseTarget</span> |
---|
48 | 00039 <span class="comment"> * <li>the mouse cursor exits a MouseTarget</span> |
---|
49 | 00040 <span class="comment"> * </ul></span> |
---|
50 | 00041 <span class="comment"> * <li> Mouse Motion Events</span> |
---|
51 | 00042 <span class="comment"> * <ul></span> |
---|
52 | 00043 <span class="comment"> * <li>the mouse is moved</span> |
---|
53 | 00044 <span class="comment"> * <li>the mouse is dragged</span> |
---|
54 | 00045 <span class="comment"> * </ul></span> |
---|
55 | 00046 <span class="comment"> * </ul></span> |
---|
56 | 00047 <span class="comment"> * <P></span> |
---|
57 | 00048 <span class="comment"> * A MouseEvent object is passed to every MouseListener</span> |
---|
58 | 00049 <span class="comment"> * object which registered to receive </span> |
---|
59 | 00050 <span class="comment"> * the "interesting" mouse events using MouseTarget's </span> |
---|
60 | 00051 <span class="comment"> * <code>addMouseListener</code> method.</span> |
---|
61 | 00052 <span class="comment"> *</span> |
---|
62 | 00053 <span class="comment"> * A MouseEvent object is also passed to every MouseMotionListener</span> |
---|
63 | 00054 <span class="comment"> * object which registered to receive </span> |
---|
64 | 00055 <span class="comment"> * mouse motion events using the MouseTarget's addMouseMotionListener</span> |
---|
65 | 00056 <span class="comment"> * method</span> |
---|
66 | 00057 <span class="comment"> *</span> |
---|
67 | 00058 <span class="comment"> * When a mouse button is clicked, events are generated and sent to the</span> |
---|
68 | 00059 <span class="comment"> * registered MouseListeners, with the button mask set in the modifier field.</span> |
---|
69 | 00060 <span class="comment"> * For example, if the first mouse button is pressed, events are sent in the</span> |
---|
70 | 00061 <span class="comment"> * following order:</span> |
---|
71 | 00062 <span class="comment"> * <PRE></span> |
---|
72 | 00063 <span class="comment"> * MOUSE_PRESSED: BUTTON1_MASK</span> |
---|
73 | 00064 <span class="comment"> * MOUSE_RELEASED: BUTTON1_MASK</span> |
---|
74 | 00065 <span class="comment"> * MOUSE_CLICKED: BUTTON1_MASK</span> |
---|
75 | 00066 <span class="comment"> * </PRE></span> |
---|
76 | 00067 <span class="comment"> * When multiple mouse buttons are pressed, each press, release, and click</span> |
---|
77 | 00068 <span class="comment"> * results in a separate event. The button mask in the modifier field reflects</span> |
---|
78 | 00069 <span class="comment"> * only the button that changed state, not the current state of all buttons.</span> |
---|
79 | 00070 <span class="comment"> * <P> </span> |
---|
80 | 00071 <span class="comment"> * For example, if the user presses button 1 followed by button 2 and</span> |
---|
81 | 00072 <span class="comment"> * releases them in the same order, the following sequence of events is</span> |
---|
82 | 00073 <span class="comment"> * generated:</span> |
---|
83 | 00074 <span class="comment"> * <PRE></span> |
---|
84 | 00075 <span class="comment"> * MOUSE_PRESSED: BUTTON1_MASK</span> |
---|
85 | 00076 <span class="comment"> * MOUSE_PRESSED: BUTTON2_MASK</span> |
---|
86 | 00077 <span class="comment"> * MOUSE_RELEASED: BUTTON1_MASK</span> |
---|
87 | 00078 <span class="comment"> * MOUSE_CLICKED: BUTTON1_MASK</span> |
---|
88 | 00079 <span class="comment"> * MOUSE_RELEASED: BUTTON2_MASK</span> |
---|
89 | 00080 <span class="comment"> * MOUSE_CLICKED: BUTTON2_MASK</span> |
---|
90 | 00081 <span class="comment"> * </PRE></span> |
---|
91 | 00082 <span class="comment"> * If button2 is released first, the MOUSE_RELEASED/MOUSE_CLICKED pair</span> |
---|
92 | 00083 <span class="comment"> * for BUTTON2_MASK arrives first, followed by the pair for BUTTON1_MASK.</span> |
---|
93 | 00084 <span class="comment"> *</span> |
---|
94 | 00085 <span class="comment">-------------------</span> |
---|
95 | 00086 <span class="comment">begin : Dec 03 2002</span> |
---|
96 | 00087 <span class="comment">copyright : (C) 2002 by Kenny Sabir</span> |
---|
97 | 00088 <span class="comment">email : kenny@sparksuit.com</span> |
---|
98 | 00089 <span class="comment">***************************************************************************/</span> |
---|
99 | 00090 <span class="preprocessor">#ifndef __MouseEvent_H__</span> |
---|
100 | 00091 <span class="preprocessor"></span><span class="preprocessor">#define __MouseEvent_H__</span> |
---|
101 | 00092 <span class="preprocessor"></span> |
---|
102 | 00093 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
103 | 00094 <span class="preprocessor">#include "<a class="code" href="OgreInputEvent_8h.html">OgreInputEvent.h</a>"</span> |
---|
104 | 00095 |
---|
105 | 00096 <span class="keyword">namespace </span>Ogre { |
---|
106 | 00097 |
---|
107 | <a name="l00158"></a><a class="code" href="classOgre_1_1MouseEvent.html">00158</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> MouseEvent : <span class="keyword">public</span> <a class="code" href="classOgre_1_1InputEvent.html">InputEvent</a> |
---|
108 | 00159 { |
---|
109 | 00160 <span class="keyword">protected</span>: |
---|
110 | <a name="l00166"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp0">00166</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mX; |
---|
111 | <a name="l00172"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp1">00172</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mY; |
---|
112 | 00173 |
---|
113 | <a name="l00179"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp2">00179</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mZ; |
---|
114 | 00180 |
---|
115 | 00181 |
---|
116 | <a name="l00182"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp3">00182</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mRelX; |
---|
117 | <a name="l00183"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp4">00183</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mRelY; |
---|
118 | <a name="l00184"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp5">00184</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mRelZ; |
---|
119 | 00185 |
---|
120 | <a name="l00190"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp6">00190</a> <span class="keywordtype">int</span> mButtonID; |
---|
121 | <a name="l00194"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventp7">00194</a> <span class="keywordtype">int</span> mClickCount; |
---|
122 | 00195 |
---|
123 | 00196 |
---|
124 | 00197 |
---|
125 | 00198 |
---|
126 | 00199 <span class="keyword">public</span>: |
---|
127 | 00200 |
---|
128 | 00201 <span class="keyword">enum</span> |
---|
129 | 00202 { |
---|
130 | 00203 ME_FIRST_EVENT = 500, |
---|
131 | 00204 ME_LAST_EVENT = 510 |
---|
132 | 00205 }; |
---|
133 | 00206 |
---|
134 | 00207 <span class="keyword">enum</span> |
---|
135 | 00208 { |
---|
136 | 00209 ME_MOUSE_CLICKED = ME_FIRST_EVENT, |
---|
137 | 00210 ME_MOUSE_PRESSED, |
---|
138 | 00211 ME_MOUSE_RELEASED, |
---|
139 | 00212 ME_MOUSE_MOVED, |
---|
140 | 00213 ME_MOUSE_ENTERED, |
---|
141 | 00214 ME_MOUSE_EXITED, |
---|
142 | 00215 ME_MOUSE_DRAGGED, |
---|
143 | 00216 |
---|
144 | 00217 ME_MOUSE_DRAGENTERED, |
---|
145 | 00218 ME_MOUSE_DRAGEXITED, |
---|
146 | 00219 ME_MOUSE_DRAGMOVED, |
---|
147 | 00220 ME_MOUSE_DRAGDROPPED |
---|
148 | 00221 }; |
---|
149 | 00222 |
---|
150 | 00236 MouseEvent(PositionTarget* source, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> whichButton, <a class="code" href="namespaceOgre.html#a420">Real</a> when, <span class="keywordtype">int</span> modifiers, |
---|
151 | 00237 <a class="code" href="namespaceOgre.html#a420">Real</a> x, <a class="code" href="namespaceOgre.html#a420">Real</a> y, <a class="code" href="namespaceOgre.html#a420">Real</a> z, <span class="keywordtype">int</span> clickCount); |
---|
152 | 00238 |
---|
153 | 00239 MouseEvent(PositionTarget* source, <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> whichButton, <a class="code" href="namespaceOgre.html#a420">Real</a> when, <span class="keywordtype">int</span> modifiers, |
---|
154 | 00240 <a class="code" href="namespaceOgre.html#a420">Real</a> x, <a class="code" href="namespaceOgre.html#a420">Real</a> y, <a class="code" href="namespaceOgre.html#a420">Real</a> z, <a class="code" href="namespaceOgre.html#a420">Real</a> relx, <a class="code" href="namespaceOgre.html#a420">Real</a> rely, <a class="code" href="namespaceOgre.html#a420">Real</a> relz, <span class="keywordtype">int</span> clickCount); |
---|
155 | 00241 |
---|
156 | 00247 <span class="keywordtype">int</span> getClickCount(); |
---|
157 | 00248 |
---|
158 | 00256 <a class="code" href="namespaceOgre.html#a420">Real</a> getX() <span class="keyword">const</span>; |
---|
159 | 00257 |
---|
160 | 00265 <a class="code" href="namespaceOgre.html#a420">Real</a> getY() <span class="keyword">const</span>; |
---|
161 | 00266 |
---|
162 | 00274 <a class="code" href="namespaceOgre.html#a420">Real</a> getZ() <span class="keyword">const</span>; |
---|
163 | 00275 |
---|
164 | <a name="l00277"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventa6">00277</a> <a class="code" href="namespaceOgre.html#a420">Real</a> getRelX()<span class="keyword"> const </span>{<span class="keywordflow">return</span> mRelX;} |
---|
165 | 00278 |
---|
166 | <a name="l00280"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventa7">00280</a> <a class="code" href="namespaceOgre.html#a420">Real</a> getRelY()<span class="keyword"> const </span>{<span class="keywordflow">return</span> mRelY;} |
---|
167 | 00281 |
---|
168 | <a name="l00283"></a><a class="code" href="classOgre_1_1MouseEvent.html#Ogre_1_1MouseEventa8">00283</a> <a class="code" href="namespaceOgre.html#a420">Real</a> getRelZ()<span class="keyword"> const </span>{<span class="keywordflow">return</span> mRelZ;} |
---|
169 | 00284 |
---|
170 | 00291 <a class="code" href="namespaceOgre.html#a426">String</a> paramString() <span class="keyword">const</span>; |
---|
171 | 00292 |
---|
172 | 00300 <span class="keywordtype">void</span> translatePoint(<a class="code" href="namespaceOgre.html#a420">Real</a> x, <a class="code" href="namespaceOgre.html#a420">Real</a> y); |
---|
173 | 00301 |
---|
174 | 00303 <span class="keywordtype">int</span> getButtonID() <span class="keyword">const</span>; |
---|
175 | 00304 }; |
---|
176 | 00305 |
---|
177 | 00306 |
---|
178 | 00307 } |
---|
179 | 00308 |
---|
180 | 00309 |
---|
181 | 00310 <span class="preprocessor">#endif </span> |
---|
182 | 00311 <span class="preprocessor"></span> |
---|
183 | </pre></div><hr> |
---|
184 | <p> |
---|
185 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
186 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
187 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
188 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
189 | <Work rdf:about=""> |
---|
190 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
191 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
192 | </Work> |
---|
193 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
194 | |
---|
195 | Last modified Sun Feb 12 12:59:48 2006 |
---|
196 | </p> |
---|
197 | </body> |
---|
198 | </html> |
---|