D:/Programmation/Cpp/SFML/src/SFML/Window/Event.hpp

00001 
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024 
00025 #ifndef SFML_EVENT_HPP
00026 #define SFML_EVENT_HPP
00027 
00028 
00032 struct sfKey
00033 {
00034     enum Code
00035     {
00036         A = 'a', Z = 'z', E = 'e', R = 'r', T = 't', Y = 'y', U = 'u', I = 'i', O = 'o', P = 'p',
00037         Q = 'q', S = 's', D = 'd', F = 'f', G = 'g', H = 'h', J = 'j', K = 'k', L = 'l', M = 'm',
00038         W = 'w', X = 'x', C = 'c', V = 'v', B = 'b', N = 'n',
00039         Num0 = '0', Num1 = '1', Num2 = '2', Num3 = '3', Num4 = '4',
00040         Num5 = '5', Num6 = '6', Num7 = '7', Num8 = '8', Num9 = '9', 
00041         Escape = 256,
00042         Space, Return, Back, Tab, PageUp, PageDown, End, Home, Insert, Delete, Add, Subtract, Multiply, Divide,
00043         Left, Right, Up, Down,
00044         Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9,
00045         F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15,
00046 
00047         Count // For internal use
00048     };
00049 };
00050 
00051 
00055 struct sfButton
00056 {
00057     enum Code
00058     {
00059         Left,
00060         Right,
00061         Middle,
00062 
00063         Count // For internal use
00064     };
00065 };
00066 
00067 
00071 class sfEvent
00072 {
00073 public :
00074 
00078     enum EventType
00079     {
00080         Close,
00081         Resize,
00082         LostFocus,
00083         GainedFocus,
00084         KeyPressed,
00085         KeyReleased,
00086         ButtonPressed,
00087         ButtonReleased,
00088         MouseMove,
00089     };
00090 
00092     // Member data
00094     EventType Type; 
00095 
00096     union
00097     {
00101         struct
00102         {
00103             sfKey::Code Code;
00104             bool        Alt;
00105             bool        Control;
00106             bool        Shift;
00107         } Key;
00108 
00112         struct
00113         {
00114             sfButton::Code Button;
00115             unsigned       int X;
00116             unsigned       int Y;
00117         } Mouse;
00118 
00122         struct
00123         {
00124             unsigned int Width;
00125             unsigned int Height;
00126         } Size;
00127     };
00128 };
00129 
00130 
00131 #endif // SFML_EVENT_HPP

Generated for SFML by  doxygen 1.5.2