Loading...
Searching...
No Matches
Event.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
5//
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.
8//
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:
12//
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.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef SFML_EVENT_HPP
26#define SFML_EVENT_HPP
27
29// Headers
31#include <SFML/Config.hpp>
32
33
34namespace sf
35{
39namespace Key
40{
147}
148
149
153namespace Mouse
154{
156 {
162
163 ButtonCount // Keep last -- total number of mouse buttons
164 };
165}
166
167
171namespace Joy
172{
173 enum Axis
174 {
182
183 AxisCount // Keep last -- total number of joystick axis
184 };
185
186 enum
187 {
188 Count = 4,
190 };
191}
192
193
197class Event
198{
199public :
200
204 struct KeyEvent
205 {
207 bool Alt;
209 bool Shift;
210 };
211
216 {
217 Uint32 Unicode;
218 };
219
224 {
225 int X;
226 int Y;
227 };
228
233 {
235 int X;
236 int Y;
237 };
238
243 {
244 int Delta;
245 };
246
251 {
252 unsigned int JoystickId;
254 float Position;
255 };
256
261 {
262 unsigned int JoystickId;
263 unsigned int Button;
264 };
265
270 {
271 unsigned int Width;
272 unsigned int Height;
273 };
274
299
301 // Member data
304
305 union
306 {
315 };
316};
317
318} // namespace sf
319
320
321#endif // SFML_EVENT_HPP
Event defines a system event and its parameters.
Definition Event.hpp:198
MouseMoveEvent MouseMove
Definition Event.hpp:309
KeyEvent Key
Definition Event.hpp:307
MouseWheelEvent MouseWheel
Definition Event.hpp:311
JoyMoveEvent JoyMove
Definition Event.hpp:312
EventType Type
Type of the event.
Definition Event.hpp:303
TextEvent Text
Definition Event.hpp:308
MouseButtonEvent MouseButton
Definition Event.hpp:310
SizeEvent Size
Definition Event.hpp:314
JoyButtonEvent JoyButton
Definition Event.hpp:313
EventType
Enumeration of the different types of events.
Definition Event.hpp:279
@ MouseMoved
Definition Event.hpp:290
@ MouseEntered
Definition Event.hpp:291
@ MouseButtonPressed
Definition Event.hpp:288
@ MouseWheelMoved
Definition Event.hpp:287
@ TextEntered
Definition Event.hpp:284
@ GainedFocus
Definition Event.hpp:283
@ MouseButtonReleased
Definition Event.hpp:289
@ KeyReleased
Definition Event.hpp:286
@ MouseLeft
Definition Event.hpp:292
@ LostFocus
Definition Event.hpp:282
@ KeyPressed
Definition Event.hpp:285
@ JoyButtonPressed
Definition Event.hpp:293
@ JoyButtonReleased
Definition Event.hpp:294
Definition of joystick axis for joystick events.
Definition Event.hpp:172
@ Count
Total number of supported joysticks.
Definition Event.hpp:188
@ ButtonCount
Total number of supported joystick buttons.
Definition Event.hpp:189
@ AxisCount
Definition Event.hpp:183
@ AxisY
Definition Event.hpp:176
@ AxisPOV
Definition Event.hpp:181
@ AxisX
Definition Event.hpp:175
@ AxisR
Definition Event.hpp:178
@ AxisZ
Definition Event.hpp:177
@ AxisV
Definition Event.hpp:180
@ AxisU
Definition Event.hpp:179
Definition of key codes for keyboard events.
Definition Event.hpp:40
@ Num1
Definition Event.hpp:70
@ Multiply
Definition Event.hpp:112
@ Pause
Definition Event.hpp:143
@ Left
Left arrow.
Definition Event.hpp:114
@ Num3
Definition Event.hpp:72
@ Count
Definition Event.hpp:145
@ Numpad9
Definition Event.hpp:127
@ Space
Definition Event.hpp:100
@ Right
Right arrow.
Definition Event.hpp:115
@ Numpad1
Definition Event.hpp:119
@ Numpad7
Definition Event.hpp:125
@ Menu
Definition Event.hpp:88
@ PageDown
Definition Event.hpp:105
@ Numpad5
Definition Event.hpp:123
@ PageUp
Definition Event.hpp:104
@ RSystem
OS specific key (right side) : windows (Win and Linux), apple (MacOS), ...
Definition Event.hpp:87
@ Period
Definition Event.hpp:93
@ Insert
Definition Event.hpp:108
@ Slash
/
Definition Event.hpp:95
@ Equal
=
Definition Event.hpp:98
@ Subtract
Definition Event.hpp:111
@ Numpad4
Definition Event.hpp:122
@ Num8
Definition Event.hpp:77
@ RControl
Definition Event.hpp:84
@ Numpad8
Definition Event.hpp:126
@ LBracket
[
Definition Event.hpp:89
@ LSystem
OS specific key (left side) : windows (Win and Linux), apple (MacOS), ...
Definition Event.hpp:83
@ Numpad3
Definition Event.hpp:121
@ Num9
Definition Event.hpp:78
@ SemiColon
;
Definition Event.hpp:91
@ Up
Up arrow.
Definition Event.hpp:116
@ RBracket
]
Definition Event.hpp:90
@ Delete
Definition Event.hpp:109
@ Return
Definition Event.hpp:101
@ Num6
Definition Event.hpp:75
@ Num7
Definition Event.hpp:76
@ Num0
Definition Event.hpp:69
@ Numpad6
Definition Event.hpp:124
@ Num4
Definition Event.hpp:73
@ LShift
Definition Event.hpp:81
@ Num5
Definition Event.hpp:74
@ Escape
Definition Event.hpp:79
@ Dash
Definition Event.hpp:99
@ BackSlash
Definition Event.hpp:96
@ RShift
Definition Event.hpp:85
@ Comma
,
Definition Event.hpp:92
@ Quote
'
Definition Event.hpp:94
@ Down
Down arrow.
Definition Event.hpp:117
@ RAlt
Definition Event.hpp:86
@ Tilde
~
Definition Event.hpp:97
@ LControl
Definition Event.hpp:80
@ Divide
/
Definition Event.hpp:113
@ Num2
Definition Event.hpp:71
@ LAlt
Definition Event.hpp:82
@ Numpad0
Definition Event.hpp:118
@ Numpad2
Definition Event.hpp:120
Definition of button codes for mouse events.
Definition Event.hpp:154
@ ButtonCount
Definition Event.hpp:163
Joystick buttons events parameters.
Definition Event.hpp:261
unsigned int JoystickId
Definition Event.hpp:262
Joystick axis move event parameters.
Definition Event.hpp:251
unsigned int JoystickId
Definition Event.hpp:252
Keyboard event parameters.
Definition Event.hpp:205
Mouse buttons events parameters.
Definition Event.hpp:233
Mouse move event parameters.
Definition Event.hpp:224
Mouse wheel events parameters.
Definition Event.hpp:243
Size events parameters.
Definition Event.hpp:270
unsigned int Height
Definition Event.hpp:272
unsigned int Width
Definition Event.hpp:271
Text event parameters.
Definition Event.hpp:216