TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tb_application_input.hpp
1 
9 #ifndef TurtleBrains_ApplicationInput_hpp
10 #define TurtleBrains_ApplicationInput_hpp
11 
12 namespace TurtleBrains
13 {
14  namespace Application
15  {
16 
37  enum Key
38  {
39  tbKey0, tbKey1, tbKey2, tbKey3, tbKey4, tbKey5, tbKey6, tbKey7, tbKey8, tbKey9,
40  tbKeyNumpad0, tbKeyNumpad1, tbKeyNumpad2, tbKeyNumpad3, tbKeyNumpad4,
41  tbKeyNumpad5, tbKeyNumpad6, tbKeyNumpad7, tbKeyNumpad8, tbKeyNumpad9,
42  tbKeyNumpadDivide, tbKeyNumpadMultiply, tbKeyNumpadSubtract, tbKeyNumpadAdd, tbKeyNumpadEnter, tbKeyNumpadPeriod,
43  tbKeyA, tbKeyB, tbKeyC, tbKeyD, tbKeyE, tbKeyF, tbKeyG, tbKeyH, tbKeyI, tbKeyJ,
44  tbKeyK, tbKeyL, tbKeyM, tbKeyN, tbKeyO, tbKeyP, tbKeyQ, tbKeyR, tbKeyS, tbKeyT,
45  tbKeyU, tbKeyV, tbKeyW, tbKeyX, tbKeyY, tbKeyZ,
46  tbKeyUp, tbKeyDown, tbKeyLeft, tbKeyRight,
47  tbKeySpace, tbKeyBackspace, tbKeyEscape, tbKeyEnter, tbKeyTab,
48  tbKeyInsert, tbKeyDelete, tbKeyPageUp, tbKeyPageDown, tbKeyHome, tbKeyEnd,
49  tbKeyLeftShift, tbKeyRightShift, tbKeyShiftModifier,
50  tbKeyLeftControl, tbKeyRightControl, tbKeyControlModifier,
51  tbKeyLeftAlt, tbKeyRightAlt, tbKeyAltModifier,
52  tbKeyCapsLock, tbKeyNumLock, tbKeyScrollLock, tbKeyCapsLockModifier, tbKeyNumLockModifier, tbKeyScrollLockModifier,
53  tbKeyPrintScreen, tbKeyPause,
54  tbKeyF1, tbKeyF2, tbKeyF3, tbKeyF4, tbKeyF5, tbKeyF6, tbKeyF7, tbKeyF8, tbKeyF9, tbKeyF10, tbKeyF11, tbKeyF12,
55  //Apparently the following can vary by keyboard, these are named after the US Keyboard...
56  //Use at your own risk.
57  tbKeyTilde, tbKeyComma, tbKeyPeriod, tbKeySlash, tbKeyBackSlash, tbKeyMinus, tbKeyPlus,
58  tbKeyColon, tbKeyLeftBracket, tbKeyRightBracket, tbKeyQuote,
59  tbMouseLeft, tbMouseRight, tbMouseMiddle, tbKeyMax,
60 
61  tbKeyInvalid = tbKeyMax
62  };
63 
64  //
65  // TODO: TIM: Planning: Do we need this? The idea was that we would post events to the RealtimeApplication.
66  //
67  //enum InputEvent
68  //{
69  // kPressedEvent,
70  // kReleasedEvent,
71  // //kRepeatEvent,
72  // kMoveEvent,
73  //};
74 
75  namespace Input
76  {
86  bool IsKeyPressed(const Key& key);
87 
97  bool IsKeyReleased(const Key& key);
98 
107  bool IsKeyDown(const Key& key);
108 
118  void GetMousePosition(int* mouseX, int* mouseY);
119 
129  bool GetMouseMovement(int* mouseX, int* mouseY);
130 
140  void SetMousePosition(int mouseX, int mouseY);
141 
149  int GetMouseWheelDelta(void);
150 
162  float GetMouseWheelDeltaPrecise(void);
163 
164  }; /* namespace Input */
165 
166  }; /* namespace Application */
167 }; /* namespace TurtleBrains */
168 
170 
171 #endif /* TurtleBrains_ApplicationMenu_hpp */
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp:21
Contains classes, functions and constants to create Applications, Menus, Dialogs with native controls...
Definition: tb_application_dialog.hpp:23
Key
Definition: tb_application_input.hpp:37