2 * Manager for mouse events
6 * ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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.
22 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 * All rights reserved.
25 * The Original Code is: all of this file.
27 * Contributor(s): none yet.
29 * ***** END GPL LICENSE BLOCK *****
33 #ifndef __KX_MOUSEMANAGER
34 #define __KX_MOUSEMANAGER
37 #include "SCA_EventManager.h"
43 #include "SCA_IInputDevice.h"
46 class SCA_MouseManager : public SCA_EventManager
49 class SCA_IInputDevice* m_mousedevice;
50 class SCA_LogicManager* m_logicmanager;
52 unsigned short m_xpos; // Cached location of the mouse pointer
53 unsigned short m_ypos;
56 SCA_MouseManager(class SCA_LogicManager* logicmgr,class SCA_IInputDevice* mousedev);
57 virtual ~SCA_MouseManager();
60 * Checks whether a mouse button is depressed. Ignores requests on non-
61 * mouse related evenst. Can also flag mouse movement.
63 bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode);
64 virtual void NextFrame();
65 SCA_IInputDevice* GetInputDevice();
68 #ifdef WITH_CXX_GUARDEDALLOC
70 void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); }
71 void operator delete( void *mem ) { MEM_freeN(mem); }
75 #endif //__KX_MOUSEMANAGER