GG
OISInput.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /* GG is a GUI for SDL and OpenGL.
3  Copyright (C) 2007 T. Zachary Laine
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public License
7  as published by the Free Software Foundation; either version 2.1
8  of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free
17  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18  02111-1307 USA
19 
20  If you do not wish to comply with the terms of the LGPL please
21  contact the author as other terms are available for a fee.
22 
23  Zach Laine
24  whatwasthataddress@gmail.com */
25 
30 
31 #include <OIS/OISKeyboard.h>
32 #include <OIS/OISMouse.h>
33 
34 
35 namespace OIS { class InputManager; }
36 
43 class GG_OGRE_PLUGIN_API OISInput :
45  public OIS::MouseListener,
46  public OIS::KeyListener
47 {
48 public:
49  OISInput();
50  virtual ~OISInput();
51 
52  virtual const Ogre::String& getName() const;
53  virtual void install();
54  virtual void initialise();
55  virtual void shutdown();
56  virtual void uninstall();
57 
58 private:
59  virtual void HandleSystemEvents();
60  virtual void HandleWindowResize(GG::X width, GG::Y height);
61  virtual void HandleWindowClose();
62 
63  virtual bool mouseMoved(const OIS::MouseEvent &event);
64  virtual bool mousePressed(const OIS::MouseEvent &event, OIS::MouseButtonID id);
65  virtual bool mouseReleased(const OIS::MouseEvent &event, OIS::MouseButtonID id);
66 
67  virtual bool keyPressed(const OIS::KeyEvent& event);
68  virtual bool keyReleased(const OIS::KeyEvent& event);
69 
70  void CleanupInputManager();
71 
72  OIS::InputManager* m_input_manager;
73  OIS::Mouse* m_mouse;
74  OIS::Keyboard* m_keyboard;
75 };