1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of OGRE
|
---|
4 | (Object-oriented Graphics Rendering Engine)
|
---|
5 | For the latest info, see http://www.ogre3d.org/
|
---|
6 |
|
---|
7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
8 | Also see acknowledgements in Readme.html
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under
|
---|
11 | the terms of the GNU Lesser General License as published by the Free Software
|
---|
12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
13 | version.
|
---|
14 |
|
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General License along with
|
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
23 | -----------------------------------------------------------------------------
|
---|
24 | */
|
---|
25 | /***************************************************************************
|
---|
26 | OgreKeyEvent.h -
|
---|
27 | *
|
---|
28 | -------------------
|
---|
29 | begin : Dec 03 2002
|
---|
30 | copyright : (C) 2002 by Kenny Sabir
|
---|
31 | email : kenny@sparksuit.com
|
---|
32 | ***************************************************************************/
|
---|
33 | #ifndef __KeyEvent_H__
|
---|
34 | #define __KeyEvent_H__
|
---|
35 |
|
---|
36 | #include "OgrePrerequisites.h"
|
---|
37 | #include "OgreInputEvent.h"
|
---|
38 |
|
---|
39 | namespace Ogre {
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * @version 1.22 04/22/99
|
---|
43 | * @author Carl Quinn
|
---|
44 | */
|
---|
45 | class _OgreExport KeyEvent : public InputEvent
|
---|
46 | {
|
---|
47 | protected:
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Which key was pressed
|
---|
51 | */
|
---|
52 |
|
---|
53 | int mKey;
|
---|
54 |
|
---|
55 | public:
|
---|
56 |
|
---|
57 | enum
|
---|
58 | {
|
---|
59 | KE_FIRST_EVENT = 2500,
|
---|
60 | KE_LAST_EVENT = 2504
|
---|
61 | };
|
---|
62 |
|
---|
63 | enum
|
---|
64 | {
|
---|
65 | KE_KEY_CLICKED = KE_FIRST_EVENT,
|
---|
66 | KE_KEY_PRESSED,
|
---|
67 | KE_KEY_RELEASED,
|
---|
68 | KE_KEY_FOCUSIN,
|
---|
69 | KE_KEY_FOCUSOUT
|
---|
70 | };
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * Constructs a KeyEvent object with the specified source KeyTarget,
|
---|
74 | * type, modifiers, coordinates, and click count.
|
---|
75 | *
|
---|
76 | * @param source the KeyTarget that originated the event
|
---|
77 | * @param id the integer that identifies the event
|
---|
78 | * @param when a long int that gives the time the event occurred
|
---|
79 | * @param modifiers the modifier keys down during event
|
---|
80 | * (shift, ctrl, alt, meta)
|
---|
81 | * @param x the horizontal x coordinate for the key location
|
---|
82 | * @param y the vertical y coordinate for the key location
|
---|
83 | * @param clickCount the number of key clicks associated with event
|
---|
84 | */
|
---|
85 | KeyEvent(PositionTarget* source, int id, int key, Real when, int modifiers);
|
---|
86 |
|
---|
87 | /**
|
---|
88 | * Returns a parameter string identifying this event.
|
---|
89 | * This method is useful for event-logging and for debugging.
|
---|
90 | *
|
---|
91 | * @return a string identifying the event and its attributes
|
---|
92 | */
|
---|
93 | String paramString() const;
|
---|
94 |
|
---|
95 |
|
---|
96 | /** return the ID of the button */
|
---|
97 | int getKey();
|
---|
98 |
|
---|
99 | /** return the char of the button */
|
---|
100 | char getKeyChar();
|
---|
101 | };
|
---|
102 |
|
---|
103 |
|
---|
104 | }
|
---|
105 |
|
---|
106 |
|
---|
107 | #endif
|
---|
108 |
|
---|