InputHandler.hpp

Go to the documentation of this file.
00001 /*
00002 SagaEngine library
00003 Copyright (c) 2002-2006 Skalden Studio AS
00004 
00005 This software is provided 'as-is', without any express or implied 
00006 warranty. In no event will the authors be held liable for any 
00007 damages arising from the use of this software.
00008 
00009 Permission is granted to distribute the library under the terms of the 
00010 Q Public License version 1.0. Be sure to read and understand the license
00011 before using the library. It should be included here, or you may read it
00012 at http://www.trolltech.com/products/qt/licenses/licensing/qpl
00013 
00014 The original version of this library can be located at:
00015 http://www.sagaengine.com/
00016 
00017 Rune Myrland
00018 rune@skalden.com
00019 */
00020 
00021 
00022 #ifndef o3d_input_InputHandler_hpp
00023 #define o3d_input_InputHandler_hpp
00024 
00025 #include "O3dPre.hpp"
00026 #include "OIS.h"
00027 
00028 
00029 namespace se_ogre {
00030     class _SeOgreExport InputHandler {
00031     public:
00032         InputHandler(const char* name);
00033         virtual ~InputHandler();
00034 
00035         virtual bool moveCamera(float stepDelta) { return false; }
00036 
00037         virtual void keyPressed(const OIS::KeyEvent* e) {};
00038         virtual void keyReleased(const OIS::KeyEvent* e) {}
00039         virtual void mousePressed(const OIS::MouseEvent* e, int button) {}
00040         virtual void mouseReleased(const OIS::MouseEvent* e, int button) {}
00041         virtual void mouseDragged(const OIS::MouseEvent* e) {}
00042         virtual void mouseMoved(const OIS::MouseEvent* e) {}
00043 
00044 
00045         virtual bool joyButtonPressed (int button) { return true; }
00046         virtual bool joyButtonReleased (int button) { return true; }
00047         virtual bool buttonPressed (const OIS::JoyStickEvent &arg, int button) { return true; }
00048         virtual bool buttonReleased (const OIS::JoyStickEvent &arg, int button) { return true; }
00049         virtual bool axisMoved (const OIS::JoyStickEvent &arg, int axis) { return true; }
00050         virtual bool sliderMoved (const OIS::JoyStickEvent &, int) { return true; }
00051         virtual bool povMoved (const OIS::JoyStickEvent &, int) { return true; }
00052 
00053         InputHandler* below();
00054 /*
00055         virtual void keyPressedconst OIS::KeyEvent* e) = 0;
00056         virtual void keyReleased(const OIS::KeyEvent* e) = 0;
00057 
00058         virtual void mousePressed(const OIS::MouseEvent* e) = 0;
00059         virtual void mouseReleased(const OIS::MouseEvent* e) = 0;
00060 
00061         virtual void mouseMoved(const OIS::MouseEvent* e) = 0;
00062         virtual void mouseDragged(const OIS::MouseEvent* e) = 0;
00063 */
00064 
00065         bool isShiftDown() const;
00066         bool isAltDown() const;
00067         bool isControlDown() const;
00068         bool isWinDown() const;
00069 
00070         void grabFocus();
00071         void loseFocus();
00072         bool hasFocus();
00073 
00074         virtual void grabbedFocusEvent() = 0;
00075         virtual void lostFocusEvent() = 0;
00076         const char* name();
00077 
00078     private:
00079         const char* name_;
00080     };
00081 }
00082 
00083 #endif

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:05 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo