Patch to change license to GPL only, from GSR.
[blender.git] / source / gameengine / GameLogic / SCA_KeyboardManager.cpp
1 /**
2  * Manager for keyboard events
3  *
4  * $Id$
5  *
6  * ***** BEGIN GPL LICENSE BLOCK *****
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  *
22  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23  * All rights reserved.
24  *
25  * The Original Code is: all of this file.
26  *
27  * Contributor(s): none yet.
28  *
29  * ***** END GPL LICENSE BLOCK *****
30  */
31
32 #include "BoolValue.h"
33 #include "SCA_KeyboardManager.h"
34 #include "SCA_KeyboardSensor.h"
35 #include "IntValue.h"
36 #include <vector>
37
38 SCA_KeyboardManager::SCA_KeyboardManager(SCA_LogicManager* logicmgr,
39                                                                                  SCA_IInputDevice* inputdev)
40         :       SCA_EventManager(KEYBOARD_EVENTMGR),
41                 m_inputDevice(inputdev),
42                 m_logicmanager(logicmgr)
43 {
44 }
45
46
47
48 SCA_KeyboardManager::~SCA_KeyboardManager()
49 {
50 }
51
52
53
54 SCA_IInputDevice* SCA_KeyboardManager::GetInputDevice()
55 {
56         return m_inputDevice;
57 }
58
59
60
61 void SCA_KeyboardManager::NextFrame()
62 {
63         //const SCA_InputEvent& event = GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0;
64   //    cerr << "SCA_KeyboardManager::NextFrame"<< endl;
65         for (unsigned int i=0;i<m_sensors.size();i++)
66         {
67                 SCA_KeyboardSensor* keysensor = (SCA_KeyboardSensor*)m_sensors[i];
68                 keysensor->Activate(m_logicmanager,NULL);
69         }
70
71 }
72
73
74
75 void  SCA_KeyboardManager::RegisterSensor(SCA_ISensor* keysensor)
76 {
77         m_sensors.push_back(keysensor);
78 }
79
80
81
82 bool SCA_KeyboardManager::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode)
83 {
84         return false;
85         //return m_kxsystem->IsPressed(inputcode);
86 }
87