1 ////////////////////////////////////////////////////////////
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
21 // 3. This notice may not be removed or altered from any source distribution.
23 ////////////////////////////////////////////////////////////
25 #ifndef SFML_EVENT_HPP
26 #define SFML_EVENT_HPP
28 ////////////////////////////////////////////////////////////
30 ////////////////////////////////////////////////////////////
31 #include <SFML/Config.hpp>
36 ////////////////////////////////////////////////////////////
37 /// Definition of key codes for keyboard events
38 ////////////////////////////////////////////////////////////
83 LSystem, ///< OS specific key (left side) : windows (Win and Linux), apple (MacOS), ...
87 RSystem, ///< OS specific key (right side) : windows (Win and Linux), apple (MacOS), ...
114 Left, ///< Left arrow
115 Right, ///< Right arrow
117 Down, ///< Down arrow
145 Count // Keep last -- total number of keyboard keys
150 ////////////////////////////////////////////////////////////
151 /// Definition of button codes for mouse events
152 ////////////////////////////////////////////////////////////
163 ButtonCount // Keep last -- total number of mouse buttons
168 ////////////////////////////////////////////////////////////
169 /// Definition of joystick axis for joystick events
170 ////////////////////////////////////////////////////////////
183 AxisCount // Keep last -- total number of joystick axis
188 Count = 4, ///< Total number of supported joysticks
189 ButtonCount = 32 ///< Total number of supported joystick buttons
194 ////////////////////////////////////////////////////////////
195 /// Event defines a system event and its parameters
196 ////////////////////////////////////////////////////////////
201 ////////////////////////////////////////////////////////////
202 /// Keyboard event parameters
203 ////////////////////////////////////////////////////////////
212 ////////////////////////////////////////////////////////////
213 /// Text event parameters
214 ////////////////////////////////////////////////////////////
220 ////////////////////////////////////////////////////////////
221 /// Mouse move event parameters
222 ////////////////////////////////////////////////////////////
223 struct MouseMoveEvent
229 ////////////////////////////////////////////////////////////
230 /// Mouse buttons events parameters
231 ////////////////////////////////////////////////////////////
232 struct MouseButtonEvent
234 Mouse::Button Button;
239 ////////////////////////////////////////////////////////////
240 /// Mouse wheel events parameters
241 ////////////////////////////////////////////////////////////
242 struct MouseWheelEvent
247 ////////////////////////////////////////////////////////////
248 /// Joystick axis move event parameters
249 ////////////////////////////////////////////////////////////
252 unsigned int JoystickId;
257 ////////////////////////////////////////////////////////////
258 /// Joystick buttons events parameters
259 ////////////////////////////////////////////////////////////
260 struct JoyButtonEvent
262 unsigned int JoystickId;
266 ////////////////////////////////////////////////////////////
267 /// Size events parameters
268 ////////////////////////////////////////////////////////////
275 ////////////////////////////////////////////////////////////
276 /// Enumeration of the different types of events
277 ////////////////////////////////////////////////////////////
297 Count // Keep last -- total number of event types
300 ////////////////////////////////////////////////////////////
302 ////////////////////////////////////////////////////////////
303 EventType Type; ///< Type of the event
309 MouseMoveEvent MouseMove;
310 MouseButtonEvent MouseButton;
311 MouseWheelEvent MouseWheel;
312 JoyMoveEvent JoyMove;
313 JoyButtonEvent JoyButton;
321 #endif // SFML_EVENT_HPP