GlobeEngine
InputControl.h
Go to the documentation of this file.
1 //
2 // CoreViewerInputControl.h
3 //
4 // Created by Mathias Thöny on 27.12.11.
5 // Copyright (c) 2011 University of Zurich. All rights reserved.
6 //
7 
8 #ifndef CoreEngine_InputControl_h
9 #define CoreEngine_InputControl_h
10 
11 #include "OpenGL_Includes.h"
12 #include "Engine.h"
13 #include <vmmlib/matrix.hpp>
14 
15 namespace ge {
17  {
18  public:
19  InputControl();
20  ~InputControl();
21 
22  void clear();
23  void create(ge::Engine* _game);
24 
25  virtual void mouseMoveWhilePressedEvent(int button, int x, int y) = 0;
26  // buttton: 0=Left 1=Middle 2=Right
27  // state: 0=pressed or clicked 1=released 2=double clicked
28  virtual void mouseButtonEvent(int button, int state, int x, int y) = 0;
29  virtual void wheelEvent(float _input) = 0;
30 
31  virtual void keyPressEvent(unsigned char pKey) = 0;
32  virtual void keyReleaseEvent(unsigned char pKey) = 0;
33  virtual void mouseMoveStopEvent() = 0;
34  virtual void mouseMoveEvent(int x, int y) = 0;
35 
36  bool isAltPressed();
37  bool isShiftPressed();
38  bool isCtrlPressed();
39  bool isCtrlAltPressed();
40  bool isDeletePressed();
41 
42  void isAltPressed(bool _in);
43  void isShiftPressed(bool _in);
44  void isCtrlPressed(bool _in);
45  void isCtrlAltPressed(bool _in);
46  void isDeletePressed(bool _in);
47 
48  protected:
50 
51  vmml::Vector2f preMoveRotation;
52  vmml::Vector2f postMoveRotation;
53  vmml::Vector2f changeRotation;
54 
55  vmml::Vector2f preMoveShift;
56  vmml::Vector2f postMoveShift;
57  vmml::Vector2f changeShift;
58 
60 
61  bool altPressed;
66  };
67 }
68 #endif
virtual void mouseMoveWhilePressedEvent(int button, int x, int y)=0
vmml::Vector2f postMoveShift
Definition: InputControl.h:56
bool ctrlaltPressed
Definition: InputControl.h:64
vmml::Vector2f preMoveShift
Definition: InputControl.h:55
vmml::Vector2f preMoveRotation
Definition: InputControl.h:51
vmml::Vector2f postMoveRotation
Definition: InputControl.h:52
bool ctrlPressed
Definition: InputControl.h:63
vmml::Vector2f changeRotation
Definition: InputControl.h:53
bool isAltPressed()
Definition: InputControl.cpp:29
void clear()
Definition: InputControl.cpp:13
virtual void mouseMoveStopEvent()=0
vmml::Vector2f changeShift
Definition: InputControl.h:57
bool isShiftPressed()
Definition: InputControl.cpp:33
bool shiftPressed
Definition: InputControl.h:62
void create(ge::Engine *_game)
Definition: InputControl.cpp:24
virtual void keyPressEvent(unsigned char pKey)=0
virtual void mouseButtonEvent(int button, int state, int x, int y)=0
bool altPressed
Definition: InputControl.h:61
bool mouseButtonHold
Definition: InputControl.h:59
Definition: Engine.h:20
ge::Engine * game
Definition: InputControl.h:49
InputControl()
Definition: InputControl.cpp:5
virtual void mouseMoveEvent(int x, int y)=0
bool isCtrlPressed()
Definition: InputControl.cpp:37
bool isDeletePressed()
Definition: InputControl.cpp:45
Definition: AvalancheTrainingSimulationEngine.h:28
virtual void keyReleaseEvent(unsigned char pKey)=0
bool deletePressed
Definition: InputControl.h:65
bool isCtrlAltPressed()
Definition: InputControl.cpp:41
Definition: InputControl.h:16
~InputControl()
Definition: InputControl.cpp:9
virtual void wheelEvent(float _input)=0