-
Notifications
You must be signed in to change notification settings - Fork 2
/
InputListener.h
42 lines (31 loc) · 1.17 KB
/
InputListener.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// InputListener.h
// @author Eric D. Wills
#ifndef __TERRAIN_DEMO_FRAME_LISTENER_H__
#define __TERRAIN_DEMO_FRAME_LISTENER_H__
#include "Ogre.h"
#include "OIS/OIS.h"
class Game;
class InputListener : public Ogre::FrameListener, public OIS::MouseListener, public OIS::KeyListener {
private:
Game* const game;
Ogre::RenderWindow * const renderWindow;
OIS::InputManager* inputManager;
OIS::Mouse* mouse;
OIS::Keyboard* keyboard;
bool forwardKeyDown, backKeyDown, upKeyDown, downKeyDown,
leftKeyDown, rightKeyDown, yawLeftKeyDown, yawRightKeyDown;
bool shiftKeyDown;
bool shutdownKeyPressed;
int levelKeyPressed;
public:
InputListener(Game* game, Ogre::RenderWindow * renderWindow);
~InputListener();
bool frameStarted(const Ogre::FrameEvent& event);
bool frameEnded(const Ogre::FrameEvent& event);
bool mousePressed(const OIS::MouseEvent& event, OIS::MouseButtonID buttonID);
bool mouseReleased(const OIS::MouseEvent& event, OIS::MouseButtonID buttonID);
bool mouseMoved(const OIS::MouseEvent& event);
bool keyPressed(const OIS::KeyEvent& event);
bool keyReleased(const OIS::KeyEvent& event);
};
#endif