www.pudn.com > MyGame.rar > InputHandler.h
#ifndef INPUTHANDLER_H
#define INPUTHANDLER_H
#include <Ogre.h>
#include <OIS/OIS.h>
#include <CEGUI/CEGUI.h>
#include <OgreCEGUIRenderer.h>
#include "NxOgre.h"
#include "Application.h"
using namespace Ogre;
using namespace NxOgre;
class Application;
class InputHandler : public FrameListener
{
public:
InputHandler(OIS::Keyboard *keyboard, OIS::Mouse *mouse, Application *app);
bool frameStarted(const FrameEvent&amt; evt);
private:
bool freeCameraHandle(const FrameEvent&amt; evt);
bool wowCameraHandle(const FrameEvent&amt; evt);
bool playerHandle(const FrameEvent&amt; evt);
bool switchViewHandle(const FrameEvent&amt; evt);
OIS::Keyboard *mKeyboard;
OIS::Mouse *mMouse;
bool mMouseDown; // Whether or not the left mouse button was down last frame
Real mToggle; // The time left until next toggle
Real mRotate; // The rotate constant
Real mMove; // The movement constant
Application* mApp;
typedef bool (InputHandler::*CameraHandle)(const FrameEvent&amt;);
CameraHandle currentCameraHandler;
void adjustCamera();
};
#endif