O3dInputBridge.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 O3dInputBridge_hpp
00023 #define O3dInputBridge_hpp
00024 
00025 #include "O3dPre.hpp"
00026 #include <OIS.h>
00027 
00028 namespace se_ogre {
00029     // Event handler to add ability to alter curvature
00030     class _SeOgreExport O3dInputBridge 
00031         : public OIS::KeyListener
00032         , public OIS::MouseListener
00033         , public OIS::JoyStickListener {
00034 
00035     public:
00036         O3dInputBridge(Ogre::RenderWindow* win);
00037         ~O3dInputBridge();
00038 
00039         //void keyClicked(const OIS::KeyEvent& e) {}
00040         bool keyPressed(const OIS::KeyEvent& e);
00041         bool keyReleased(const OIS::KeyEvent& e);
00042 
00043         bool mousePressed(const OIS::MouseEvent& e, OIS::MouseButtonID id);
00044         bool mouseReleased(const OIS::MouseEvent& e, OIS::MouseButtonID id);
00045         //void mouseClicked(const OIS::MouseEvent* e) {}
00046         //void mouseEntered(const OIS::MouseEvent* e) {}
00047         //void mouseExited(const OIS::MouseEvent* e) {}
00048 
00049         bool mouseMoved(const OIS::MouseEvent& e);
00050         //void mouseDragged(const OIS::MouseEvent* e);
00051         //void mouseDragMoved(const OIS::MouseEvent* e) {}
00052 
00053         bool buttonPressed (const OIS::JoyStickEvent &arg, int button);
00054         bool buttonReleased (const OIS::JoyStickEvent &arg, int button);
00055         bool axisMoved (const OIS::JoyStickEvent &arg, int axis);
00056         bool sliderMoved (const OIS::JoyStickEvent &, int);
00057         bool povMoved (const OIS::JoyStickEvent &, int);
00058 
00059         void step();
00060 
00061         void initOIS();
00062 
00063         bool isShiftDown() const { return isLeftShiftDown_ || isRightShiftDown_; }
00064 
00065     private: // Attributes
00066         OIS::InputManager* inputManager_;
00067         //
00068         OIS::Mouse* mouse_;
00069         OIS::Keyboard* keyboard_;
00070         OIS::JoyStick* joy_;
00071 
00072         int oldJoyButtons_;
00073 
00074         //
00075         int keyState_;
00076 
00077         bool isLeftShiftDown_, isRightShiftDown_;
00078     };
00079 }
00080 
00081 #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