CEGUIInputEvent.h

00001 /***********************************************************************
00002         filename:       CEGUIInputEvent.h
00003         created:        30/5/2004
00004         author:         Paul D Turner
00005 
00006         purpose:        Defines interface to input event classes
00007 *************************************************************************/
00008 /***************************************************************************
00009  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
00010  *
00011  *   Permission is hereby granted, free of charge, to any person obtaining
00012  *   a copy of this software and associated documentation files (the
00013  *   "Software"), to deal in the Software without restriction, including
00014  *   without limitation the rights to use, copy, modify, merge, publish,
00015  *   distribute, sublicense, and/or sell copies of the Software, and to
00016  *   permit persons to whom the Software is furnished to do so, subject to
00017  *   the following conditions:
00018  *
00019  *   The above copyright notice and this permission notice shall be
00020  *   included in all copies or substantial portions of the Software.
00021  *
00022  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00023  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00024  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00025  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00026  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00027  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00028  *   OTHER DEALINGS IN THE SOFTWARE.
00029  ***************************************************************************/
00030 #ifndef _CEGUIInputEvent_h_
00031 #define _CEGUIInputEvent_h_
00032 
00033 #include "CEGUIBase.h"
00034 #include "CEGUIEventArgs.h"
00035 #include "CEGUIString.h"
00036 #include "CEGUIVector.h"
00037 
00038 
00039 // Start of CEGUI namespace section
00040 namespace CEGUI
00041 {
00046 struct CEGUIEXPORT Key
00047 {
00048         // enumeration of scan codes.  Customised from table taken from Ogre, which took them from DirectInput...
00049         enum Scan
00050     {
00051         Escape          =0x01,
00052         One             =0x02,
00053         Two             =0x03,
00054         Three           =0x04,
00055         Four            =0x05,
00056         Five            =0x06,
00057         Six             =0x07,
00058         Seven           =0x08,
00059         Eight           =0x09,
00060         Nine            =0x0A,
00061         Zero            =0x0B,
00062         Minus           =0x0C,    /* - on main keyboard */
00063         Equals                  =0x0D,
00064         Backspace               =0x0E,    /* backspace */
00065         Tab                             =0x0F,
00066         Q               =0x10,
00067         W               =0x11,
00068         E               =0x12,
00069         R               =0x13,
00070         T               =0x14,
00071         Y               =0x15,
00072         U               =0x16,
00073         I               =0x17,
00074         O               =0x18,
00075         P               =0x19,
00076         LeftBracket     =0x1A,
00077         RightBracket    =0x1B,
00078         Return                  =0x1C,    /* Enter on main keyboard */
00079         LeftControl             =0x1D,
00080         A               =0x1E,
00081         S               =0x1F,
00082         D               =0x20,
00083         F               =0x21,
00084         G               =0x22,
00085         H               =0x23,
00086         J               =0x24,
00087         K               =0x25,
00088         L               =0x26,
00089         Semicolon       =0x27,
00090         Apostrophe              =0x28,
00091         Grave           =0x29,    /* accent grave */
00092         LeftShift       =0x2A,
00093         Backslash       =0x2B,
00094         Z               =0x2C,
00095         X               =0x2D,
00096         C               =0x2E,
00097         V               =0x2F,
00098         B               =0x30,
00099         N               =0x31,
00100         M               =0x32,
00101         Comma           =0x33,
00102         Period          =0x34,    /* . on main keyboard */
00103         Slash           =0x35,    /* '/' on main keyboard */
00104         RightShift      =0x36,
00105         Multiply        =0x37,    /* * on numeric keypad */
00106         LeftAlt        =0x38,    /* left Alt */
00107         Space           =0x39,
00108         Capital         =0x3A,
00109         F1              =0x3B,
00110         F2              =0x3C,
00111         F3              =0x3D,
00112         F4              =0x3E,
00113         F5              =0x3F,
00114         F6              =0x40,
00115         F7              =0x41,
00116         F8              =0x42,
00117         F9              =0x43,
00118         F10             =0x44,
00119         NumLock         =0x45,
00120         ScrollLock      =0x46,    /* Scroll Lock */
00121         Numpad7         =0x47,
00122         Numpad8         =0x48,
00123         Numpad9         =0x49,
00124         Subtract        =0x4A,    /* - on numeric keypad */
00125         Numpad4         =0x4B,
00126         Numpad5         =0x4C,
00127         Numpad6         =0x4D,
00128         Add                             =0x4E,    /* + on numeric keypad */
00129         Numpad1         =0x4F,
00130         Numpad2         =0x50,
00131         Numpad3         =0x51,
00132         Numpad0         =0x52,
00133         Decimal                 =0x53,    /* . on numeric keypad */
00134         OEM_102         =0x56,    /* < > | on UK/Germany keyboards */
00135         F11             =0x57,
00136         F12             =0x58,
00137         F13             =0x64,    /*                     (NEC PC98) */
00138         F14             =0x65,    /*                     (NEC PC98) */
00139         F15             =0x66,    /*                     (NEC PC98) */
00140         Kana            =0x70,    /* (Japanese keyboard)            */
00141         ABNT_C1         =0x73,    /* / ? on Portugese (Brazilian) keyboards */
00142         Convert         =0x79,    /* (Japanese keyboard)            */
00143         NoConvert       =0x7B,    /* (Japanese keyboard)            */
00144         Yen             =0x7D,    /* (Japanese keyboard)            */
00145         ABNT_C2         =0x7E,    /* Numpad . on Portugese (Brazilian) keyboards */
00146         NumpadEquals    =0x8D,    /* = on numeric keypad (NEC PC98) */
00147         PrevTrack       =0x90,    /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
00148         At              =0x91,    /*                     (NEC PC98) */
00149         Colon           =0x92,    /*                     (NEC PC98) */
00150         Underline       =0x93,    /*                     (NEC PC98) */
00151         Kanji           =0x94,    /* (Japanese keyboard)            */
00152         Stop            =0x95,    /*                     (NEC PC98) */
00153         AX              =0x96,    /*                     (Japan AX) */
00154         Unlabeled       =0x97,    /*                        (J3100) */
00155         NextTrack       =0x99,    /* Next Track */
00156         NumpadEnter     =0x9C,    /* Enter on numeric keypad */
00157         RightControl    =0x9D,
00158         Mute            =0xA0,    /* Mute */
00159         Calculator      =0xA1,    /* Calculator */
00160         PlayPause       =0xA2,    /* Play / Pause */
00161         MediaStop       =0xA4,    /* Media Stop */
00162         VolumeDown      =0xAE,    /* Volume - */
00163         VolumeUp        =0xB0,    /* Volume + */
00164         WebHome         =0xB2,    /* Web home */
00165         NumpadComma     =0xB3,    /* , on numeric keypad (NEC PC98) */
00166         Divide          =0xB5,    /* / on numeric keypad */
00167         SysRq           =0xB7,
00168         RightAlt        =0xB8,    /* right Alt */
00169         Pause           =0xC5,    /* Pause */
00170         Home            =0xC7,    /* Home on arrow keypad */
00171         ArrowUp         =0xC8,    /* UpArrow on arrow keypad */
00172         PageUp          =0xC9,    /* PgUp on arrow keypad */
00173         ArrowLeft       =0xCB,    /* LeftArrow on arrow keypad */
00174         ArrowRight      =0xCD,    /* RightArrow on arrow keypad */
00175         End             =0xCF,    /* End on arrow keypad */
00176         ArrowDown       =0xD0,    /* DownArrow on arrow keypad */
00177         PageDown                =0xD1,    /* PgDn on arrow keypad */
00178         Insert          =0xD2,    /* Insert on arrow keypad */
00179         Delete          =0xD3,    /* Delete on arrow keypad */
00180         LeftWindows     =0xDB,    /* Left Windows key */
00181         RightWindow     =0xDC,    /* Right Windows key */
00182         RightWindows    =0xDC,    /* Right Windows key - Correct spelling :) */
00183         AppMenu         =0xDD,    /* AppMenu key */
00184         Power           =0xDE,    /* System Power */
00185         Sleep           =0xDF,    /* System Sleep */
00186         Wake                    =0xE3,    /* System Wake */
00187         WebSearch               =0xE5,    /* Web Search */
00188         WebFavorites    =0xE6,    /* Web Favorites */
00189         WebRefresh              =0xE7,    /* Web Refresh */
00190         WebStop                 =0xE8,    /* Web Stop */
00191         WebForward              =0xE9,    /* Web Forward */
00192         WebBack                 =0xEA,    /* Web Back */
00193         MyComputer              =0xEB,    /* My Computer */
00194         Mail                    =0xEC,    /* Mail */
00195         MediaSelect             =0xED     /* Media Select */
00196     };
00197 
00198 };
00199 
00200 
00205 enum MouseButton
00206 {
00208     LeftButton,
00210     RightButton,
00212     MiddleButton,
00214     X1Button,
00216     X2Button,
00218     MouseButtonCount,
00220     NoButton
00221 };
00222 
00223 
00228 enum SystemKey
00229 {
00230         LeftMouse               = 0x0001,                       
00231         RightMouse              = 0x0002,                       
00232         Shift                   = 0x0004,                       
00233         Control                 = 0x0008,                       
00234         MiddleMouse             = 0x0010,                       
00235         X1Mouse                 = 0x0020,                       
00236         X2Mouse                 = 0x0040,                       
00237         Alt                             = 0x0080                        
00238 };
00239 
00240 
00246 class CEGUIEXPORT WindowEventArgs : public EventArgs
00247 {
00248 public:
00249         WindowEventArgs(Window* wnd) : window(wnd) {
00250                 this->d_hasWindow = true;
00251         }
00252 
00253         Window* window;         
00254 };
00255 
00260 class CEGUIEXPORT UpdateEventArgs : public WindowEventArgs
00261 {
00262 public:
00263     UpdateEventArgs(Window* window, float tslf) :
00264         WindowEventArgs(window),
00265         d_timeSinceLastFrame(tslf)
00266     {}
00267 
00268         float d_timeSinceLastFrame; 
00269 };
00270 
00271 
00277 class CEGUIEXPORT MouseEventArgs : public WindowEventArgs
00278 {
00279 public:
00280         MouseEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00281 
00282         Point           position;               
00283         Vector2         moveDelta;              
00284         MouseButton     button;                 
00285         uint            sysKeys;                
00286         float           wheelChange;    
00287         uint        clickCount;     
00288 };
00289 
00290 
00296 class CEGUIEXPORT MouseCursorEventArgs : public EventArgs
00297 {
00298 public:
00299         MouseCursorEventArgs(MouseCursor* cursor) : mouseCursor(cursor) {}
00300 
00301         MouseCursor* mouseCursor;       
00302         const Image* image;                     
00303 };
00304 
00305 
00311 class CEGUIEXPORT KeyEventArgs : public WindowEventArgs
00312 {
00313 public:
00314         KeyEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00315 
00316         utf32           codepoint;              
00317         Key::Scan       scancode;               
00318         uint            sysKeys;                
00319 };
00320 
00321 
00326 class CEGUIEXPORT ActivationEventArgs : public WindowEventArgs
00327 {
00328 public:
00329         ActivationEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00330 
00331         Window* otherWindow;    
00332 };
00333 
00338 class CEGUIEXPORT DragDropEventArgs : public WindowEventArgs
00339 {
00340 public:
00341         DragDropEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00342         DragContainer*  dragDropItem; //<! pointer to the DragContainer window being dragged / dropped.
00343 };
00344 
00345 } // End of  CEGUI namespace section
00346 
00347 
00348 #endif  // end of guard _CEGUIInputEvent_h_

Generated on Sat Jun 28 14:35:44 2008 for Crazy Eddies GUI System by  doxygen 1.5.4