00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025 #ifndef SFML_EVENT_HPP
00026 #define SFML_EVENT_HPP
00027
00029
00031 #include <SFML/Config.hpp>
00032 #include <SFML/Window/Joystick.hpp>
00033 #include <SFML/Window/Keyboard.hpp>
00034 #include <SFML/Window/Mouse.hpp>
00035
00036
00037 namespace sf
00038 {
00043 class Event
00044 {
00045 public :
00046
00051 struct SizeEvent
00052 {
00053 unsigned int Width;
00054 unsigned int Height;
00055 };
00056
00061 struct KeyEvent
00062 {
00063 Keyboard::Key Code;
00064 bool Alt;
00065 bool Control;
00066 bool Shift;
00067 bool System;
00068 };
00069
00074 struct TextEvent
00075 {
00076 Uint32 Unicode;
00077 };
00078
00083 struct MouseMoveEvent
00084 {
00085 int X;
00086 int Y;
00087 };
00088
00094 struct MouseButtonEvent
00095 {
00096 Mouse::Button Button;
00097 int X;
00098 int Y;
00099 };
00100
00105 struct MouseWheelEvent
00106 {
00107 int Delta;
00108 int X;
00109 int Y;
00110 };
00111
00117 struct JoystickConnectEvent
00118 {
00119 unsigned int JoystickId;
00120 };
00121
00126 struct JoystickMoveEvent
00127 {
00128 unsigned int JoystickId;
00129 Joystick::Axis Axis;
00130 float Position;
00131 };
00132
00138 struct JoystickButtonEvent
00139 {
00140 unsigned int JoystickId;
00141 unsigned int Button;
00142 };
00143
00148 enum EventType
00149 {
00150 Closed,
00151 Resized,
00152 LostFocus,
00153 GainedFocus,
00154 TextEntered,
00155 KeyPressed,
00156 KeyReleased,
00157 MouseWheelMoved,
00158 MouseButtonPressed,
00159 MouseButtonReleased,
00160 MouseMoved,
00161 MouseEntered,
00162 MouseLeft,
00163 JoystickButtonPressed,
00164 JoystickButtonReleased,
00165 JoystickMoved,
00166 JoystickConnected,
00167 JoystickDisconnected,
00168
00169 Count
00170 };
00171
00173
00175 EventType Type;
00176
00177 union
00178 {
00179 SizeEvent Size;
00180 KeyEvent Key;
00181 TextEvent Text;
00182 MouseMoveEvent MouseMove;
00183 MouseButtonEvent MouseButton;
00184 MouseWheelEvent MouseWheel;
00185 JoystickMoveEvent JoystickMove;
00186 JoystickButtonEvent JoystickButton;
00187 JoystickConnectEvent JoystickConnect;
00188 };
00189 };
00190
00191 }
00192
00193
00194 #endif // SFML_EVENT_HPP
00195
00196