Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUIInputEvent.h

Go to the documentation of this file.
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     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00011 
00012     This library is free software; you can redistribute it and/or
00013     modify it under the terms of the GNU Lesser General Public
00014     License as published by the Free Software Foundation; either
00015     version 2.1 of the License, or (at your option) any later version.
00016 
00017     This library is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020     Lesser General Public License for more details.
00021 
00022     You should have received a copy of the GNU Lesser General Public
00023     License along with this library; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 *************************************************************************/
00026 #ifndef _CEGUIInputEvent_h_
00027 #define _CEGUIInputEvent_h_
00028 
00029 #include "CEGUIBase.h"
00030 #include "CEGUIEventArgs.h"
00031 #include "CEGUIString.h"
00032 #include "CEGUIVector.h"
00033 
00034 
00035 // Start of CEGUI namespace section
00036 namespace CEGUI
00037 {
00042 struct CEGUIBASE_API Key
00043 {
00044         // enumeration of scan codes.  Customised from table taken from Ogre, which took them from DirectInput...
00045         enum Scan
00046     {
00047         Escape          =0x01,
00048         One             =0x02,
00049         Two             =0x03,
00050         Three           =0x04,
00051         Four            =0x05,
00052         Five            =0x06,
00053         Six             =0x07,
00054         Seven           =0x08,
00055         Eight           =0x09,
00056         Nine            =0x0A,
00057         Zero            =0x0B,
00058         Minus           =0x0C,    /* - on main keyboard */
00059         Equals                  =0x0D,
00060         Backspace               =0x0E,    /* backspace */
00061         Tab                             =0x0F,
00062         Q               =0x10,
00063         W               =0x11,
00064         E               =0x12,
00065         R               =0x13,
00066         T               =0x14,
00067         Y               =0x15,
00068         U               =0x16,
00069         I               =0x17,
00070         O               =0x18,
00071         P               =0x19,
00072         LeftBracket     =0x1A,
00073         RightBracket    =0x1B,
00074         Return                  =0x1C,    /* Enter on main keyboard */
00075         LeftControl             =0x1D,
00076         A               =0x1E,
00077         S               =0x1F,
00078         D               =0x20,
00079         F               =0x21,
00080         G               =0x22,
00081         H               =0x23,
00082         J               =0x24,
00083         K               =0x25,
00084         L               =0x26,
00085         Semicolon       =0x27,
00086         Apostrophe              =0x28,
00087         Grave           =0x29,    /* accent grave */
00088         LeftShift       =0x2A,
00089         Backslash       =0x2B,
00090         Z               =0x2C,
00091         X               =0x2D,
00092         C               =0x2E,
00093         V               =0x2F,
00094         B               =0x30,
00095         N               =0x31,
00096         M               =0x32,
00097         Comma           =0x33,
00098         Period          =0x34,    /* . on main keyboard */
00099         Slash           =0x35,    /* '/' on main keyboard */
00100         RightShift      =0x36,
00101         Multiply        =0x37,    /* * on numeric keypad */
00102         LeftAlt        =0x38,    /* left Alt */
00103         Space           =0x39,
00104         Capital         =0x3A,
00105         F1              =0x3B,
00106         F2              =0x3C,
00107         F3              =0x3D,
00108         F4              =0x3E,
00109         F5              =0x3F,
00110         F6              =0x40,
00111         F7              =0x41,
00112         F8              =0x42,
00113         F9              =0x43,
00114         F10             =0x44,
00115         NumLock         =0x45,
00116         ScrollLock      =0x46,    /* Scroll Lock */
00117         Numpad7         =0x47,
00118         Numpad8         =0x48,
00119         Numpad9         =0x49,
00120         Subtract        =0x4A,    /* - on numeric keypad */
00121         Numpad4         =0x4B,
00122         Numpad5         =0x4C,
00123         Numpad6         =0x4D,
00124         Add                             =0x4E,    /* + on numeric keypad */
00125         Numpad1         =0x4F,
00126         Numpad2         =0x50,
00127         Numpad3         =0x51,
00128         Numpad0         =0x52,
00129         Decimal                 =0x53,    /* . on numeric keypad */
00130         OEM_102         =0x56,    /* < > | on UK/Germany keyboards */
00131         F11             =0x57,
00132         F12             =0x58,
00133         F13             =0x64,    /*                     (NEC PC98) */
00134         F14             =0x65,    /*                     (NEC PC98) */
00135         F15             =0x66,    /*                     (NEC PC98) */
00136         Kana            =0x70,    /* (Japanese keyboard)            */
00137         ABNT_C1         =0x73,    /* / ? on Portugese (Brazilian) keyboards */
00138         Convert         =0x79,    /* (Japanese keyboard)            */
00139         NoConvert       =0x7B,    /* (Japanese keyboard)            */
00140         Yen             =0x7D,    /* (Japanese keyboard)            */
00141         ABNT_C2         =0x7E,    /* Numpad . on Portugese (Brazilian) keyboards */
00142         NumpadEquals    =0x8D,    /* = on numeric keypad (NEC PC98) */
00143         PrevTrack       =0x90,    /* Previous Track (KC_CIRCUMFLEX on Japanese keyboard) */
00144         At              =0x91,    /*                     (NEC PC98) */
00145         Colon           =0x92,    /*                     (NEC PC98) */
00146         Underline       =0x93,    /*                     (NEC PC98) */
00147         Kanji           =0x94,    /* (Japanese keyboard)            */
00148         Stop            =0x95,    /*                     (NEC PC98) */
00149         AX              =0x96,    /*                     (Japan AX) */
00150         Unlabeled       =0x97,    /*                        (J3100) */
00151         NextTrack       =0x99,    /* Next Track */
00152         NumpadEnter     =0x9C,    /* Enter on numeric keypad */
00153         RightControl    =0x9D,
00154         Mute            =0xA0,    /* Mute */
00155         Calculator      =0xA1,    /* Calculator */
00156         PlayPause       =0xA2,    /* Play / Pause */
00157         MediaStop       =0xA4,    /* Media Stop */
00158         VolumeDown      =0xAE,    /* Volume - */
00159         VolumeUp        =0xB0,    /* Volume + */
00160         WebHome         =0xB2,    /* Web home */
00161         NumpadComma     =0xB3,    /* , on numeric keypad (NEC PC98) */
00162         Divide          =0xB5,    /* / on numeric keypad */
00163         SysRq           =0xB7,
00164         RightAlt        =0xB8,    /* right Alt */
00165         Pause           =0xC5,    /* Pause */
00166         Home            =0xC7,    /* Home on arrow keypad */
00167         ArrowUp         =0xC8,    /* UpArrow on arrow keypad */
00168         PageUp          =0xC9,    /* PgUp on arrow keypad */
00169         ArrowLeft       =0xCB,    /* LeftArrow on arrow keypad */
00170         ArrowRight      =0xCD,    /* RightArrow on arrow keypad */
00171         End             =0xCF,    /* End on arrow keypad */
00172         ArrowDown       =0xD0,    /* DownArrow on arrow keypad */
00173         PageDown                =0xD1,    /* PgDn on arrow keypad */
00174         Insert          =0xD2,    /* Insert on arrow keypad */
00175         Delete          =0xD3,    /* Delete on arrow keypad */
00176         LeftWindows     =0xDB,    /* Left Windows key */
00177         RightWindow     =0xDC,    /* Right Windows key */
00178         AppMenu         =0xDD,    /* AppMenu key */
00179         Power           =0xDE,    /* System Power */
00180         Sleep           =0xDF,    /* System Sleep */
00181         Wake                    =0xE3,    /* System Wake */
00182         WebSearch               =0xE5,    /* Web Search */
00183         WebFavorites    =0xE6,    /* Web Favorites */
00184         WebRefresh              =0xE7,    /* Web Refresh */
00185         WebStop                 =0xE8,    /* Web Stop */
00186         WebForward              =0xE9,    /* Web Forward */
00187         WebBack                 =0xEA,    /* Web Back */
00188         MyComputer              =0xEB,    /* My Computer */
00189         Mail                    =0xEC,    /* Mail */
00190         MediaSelect             =0xED     /* Media Select */
00191     };
00192 
00193 };
00194 
00195 
00200 enum MouseButton
00201 {
00202         LeftButton,
00203         RightButton,
00204         MiddleButton,
00205         X1Button,
00206         X2Button,
00207         MouseButtonCount,               //<! Dummy value that is == to the maximum number of mouse buttons supported.
00208         NoButton                                
00209 };
00210 
00211 
00216 enum CEGUIBASE_API SystemKey
00217 {
00218         LeftMouse               = 0x01,                 
00219         RightMouse              = 0x02,                 
00220         Shift                   = 0x04,                 
00221         Control                 = 0x08,                 
00222         MiddleMouse             = 0x10,                 
00223         X1Mouse                 = 0x20,                 
00224         X2Mouse                 = 0x40,                 
00225 };
00226 
00227 
00233 class CEGUIBASE_API WindowEventArgs : public EventArgs
00234 {
00235 public:
00236         WindowEventArgs(Window* wnd) : window(wnd) {}
00237 
00238         Window* window;         
00239 };
00240 
00241 
00247 class CEGUIBASE_API MouseEventArgs : public WindowEventArgs
00248 {
00249 public:
00250         MouseEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00251 
00252         Point           position;               
00253         Vector2         moveDelta;              
00254         MouseButton     button;                 
00255         uint            sysKeys;                
00256         float           wheelChange;    
00257 };
00258 
00259 
00265 class CEGUIBASE_API MouseCursorEventArgs : public EventArgs
00266 {
00267 public:
00268         MouseCursorEventArgs(MouseCursor* cursor) : mouseCursor(cursor) {}
00269 
00270         MouseCursor* mouseCursor;       
00271         const Image* image;                     
00272 };
00273 
00274 
00280 class CEGUIBASE_API KeyEventArgs : public WindowEventArgs
00281 {
00282 public:
00283         KeyEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00284 
00285         utf32           codepoint;              
00286         Key::Scan       scancode;               
00287         uint            sysKeys;                
00288 };
00289 
00290 
00295 class CEGUIBASE_API ActivationEventArgs : public WindowEventArgs
00296 {
00297 public:
00298         ActivationEventArgs(Window* wnd) : WindowEventArgs(wnd) {}
00299 
00300         Window* otherWindow;    
00301 };
00302 
00303 
00304 } // End of  CEGUI namespace section
00305 
00306 
00307 #endif  // end of guard _CEGUIInputEvent_h_

Generated on Wed Feb 16 12:41:06 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1