Changeset 8729 for code/trunk/src/libraries/core/input
- Timestamp:
- Jul 4, 2011, 2:47:44 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/core/input/InputHandler.h
r6746 r8729 31 31 32 32 #include "InputPrereqs.h" 33 #include "util/Math.h"34 33 35 34 namespace orxonox 36 35 { 36 /// A Vector class containing two integers @a x and @a y. 37 class IntVector2 38 { 39 public: 40 IntVector2() : x(0), y(0) { } 41 IntVector2(int _x, int _y) : x(_x), y(_y) { } 42 int x; 43 int y; 44 }; 45 37 46 namespace ButtonEvent 38 47 { -
code/trunk/src/libraries/core/input/InputManager.cc
r8351 r8729 94 94 , oisInputManager_(0) 95 95 , devices_(2) 96 , exclusiveMouse_( TriBool::False)96 , exclusiveMouse_(false) 97 97 , emptyState_(0) 98 98 , calibratorCallbackHandler_(0) … … 108 108 109 109 if (GraphicsManager::getInstance().isFullScreen()) 110 exclusiveMouse_ = TriBool::True;110 exclusiveMouse_ = true; 111 111 this->loadDevices(); 112 112 … … 161 161 paramList.insert(StringPair("w32_keyboard", "DISCL_FOREGROUND")); 162 162 paramList.insert(StringPair("w32_mouse", "DISCL_FOREGROUND")); 163 if (exclusiveMouse_ == TriBool::True|| GraphicsManager::getInstance().isFullScreen())163 if (exclusiveMouse_ || GraphicsManager::getInstance().isFullScreen()) 164 164 { 165 165 // Disable Windows key plus special keys (like play, stop, next, etc.) … … 174 174 paramList.insert(StringPair("XAutoRepeatOn", "true")); 175 175 176 if (exclusiveMouse_ == TriBool::True|| GraphicsManager::getInstance().isFullScreen())176 if (exclusiveMouse_ || GraphicsManager::getInstance().isFullScreen()) 177 177 { 178 178 if (CommandLineParser::getValue("keyboard_no_grab").getBool()) … … 447 447 448 448 // Check whether we have to change the mouse mode 449 TriBool::Value requestedMode = TriBool::Dontcare;449 tribool requestedMode = dontcare; 450 450 std::vector<InputState*>& mouseStates = devices_[InputDeviceEnumerator::Mouse]->getStateListRef(); 451 451 if (mouseStates.empty()) 452 requestedMode = TriBool::False;452 requestedMode = false; 453 453 else 454 454 requestedMode = mouseStates.front()->getMouseExclusive(); 455 if (requestedMode != TriBool::Dontcare && exclusiveMouse_ != requestedMode) 456 { 457 exclusiveMouse_ = requestedMode; 455 if (requestedMode != dontcare && exclusiveMouse_ != requestedMode) 456 { 457 assert(requestedMode != dontcare); 458 exclusiveMouse_ = (requestedMode == true); 458 459 if (!GraphicsManager::getInstance().isFullScreen()) 459 460 this->reloadInternal(); … … 644 645 } 645 646 646 bool InputManager::setMouseExclusive(const std::string& name, TriBool::Valuevalue)647 bool InputManager::setMouseExclusive(const std::string& name, tribool value) 647 648 { 648 649 if (name == "empty") -
code/trunk/src/libraries/core/input/InputManager.h
r8079 r8729 33 33 34 34 #include <map> 35 #include <set>36 35 #include <string> 37 36 #include <vector> … … 39 38 40 39 #include "util/Singleton.h" 41 #include "util/ TriBool.h"40 #include "util/tribool.h" 42 41 #include "core/WindowEventListener.h" 43 42 … … 169 168 True if the call was successful, fals if the name was not found 170 169 */ 171 bool setMouseExclusive(const std::string& name, TriBool::Valuevalue); // tolua_export170 bool setMouseExclusive(const std::string& name, tribool value); // tolua_export 172 171 173 172 //------------------------------- … … 215 214 OIS::InputManager* oisInputManager_; //!< OIS input manager 216 215 std::vector<InputDevice*> devices_; //!< List of all input devices (keyboard, mouse, joy sticks) 217 TriBool::ValueexclusiveMouse_; //!< Currently applied mouse mode216 bool exclusiveMouse_; //!< Currently applied mouse mode 218 217 219 218 // some internally handled states and handlers -
code/trunk/src/libraries/core/input/InputPrereqs.h
r6746 r8729 41 41 #include <ois/OISKeyboard.h> 42 42 #include <ois/OISMouse.h> 43 #include <ois/OISJoyStick.h>44 43 #include "util/OrxEnum.h" 45 44 -
code/trunk/src/libraries/core/input/InputState.cc
r7284 r8729 37 37 , bAlwaysGetsInput_(bAlwaysGetsInput) 38 38 , bTransparent_(bTransparent) 39 , exclusiveMouse_( TriBool::Dontcare)39 , exclusiveMouse_(dontcare) 40 40 , bExpired_(true) 41 41 , handlers_(2) -
code/trunk/src/libraries/core/input/InputState.h
r8351 r8729 38 38 #include <boost/bind.hpp> 39 39 40 #include "util/ TriBool.h"40 #include "util/tribool.h" 41 41 #include "InputHandler.h" 42 42 #include "InputManager.h" … … 112 112 void setHandler (InputHandler* handler); 113 113 114 void setMouseExclusive( TriBool::Valuevalue) { exclusiveMouse_ = value; this->bExpired_ = true; }115 TriBool::ValuegetMouseExclusive() const { return exclusiveMouse_; }114 void setMouseExclusive(tribool value) { exclusiveMouse_ = value; this->bExpired_ = true; } 115 tribool getMouseExclusive() const { return exclusiveMouse_; } 116 116 117 117 //! Returns the name of the state (which is unique!) … … 166 166 const bool bAlwaysGetsInput_; //!< See class declaration for explanation 167 167 const bool bTransparent_; //!< See class declaration for explanation 168 TriBool::ValueexclusiveMouse_; //!< See class declaration for explanation168 tribool exclusiveMouse_; //!< See class declaration for explanation 169 169 int priority_; //!< Current priority (might change) 170 170 bool bExpired_; //!< See hasExpired() -
code/trunk/src/libraries/core/input/JoyStick.h
r7809 r8729 34 34 #include <string> 35 35 #include <vector> 36 #include <ois/OISJoyStick.h> 36 37 #include "InputDevice.h" 37 38 -
code/trunk/src/libraries/core/input/JoyStickQuantityListener.h
r6417 r8729 36 36 37 37 #include "InputPrereqs.h" 38 39 #include <vector> 38 40 #include "core/OrxonoxClass.h" 39 41 -
code/trunk/src/libraries/core/input/KeyBinderManager.h
r7284 r8729 34 34 #include <map> 35 35 #include <string> 36 #include <boost/shared_ptr.hpp>37 36 38 37 #include "util/Singleton.h" -
code/trunk/src/libraries/core/input/KeyDetector.h
r7284 r8729 32 32 #include "InputPrereqs.h" 33 33 34 #include <boost/shared_ptr.hpp>35 34 #include "util/Singleton.h" 36 35 #include "KeyBinder.h" -
code/trunk/src/libraries/core/input/Keyboard.h
r8079 r8729 31 31 32 32 #include "InputPrereqs.h" 33 34 #include "InputHandler.h"35 33 #include "InputDevice.h" 36 34 -
code/trunk/src/libraries/core/input/Mouse.cc
r7284 r8729 37 37 // include this as last, X11 seems to define some macros... 38 38 #include <ois/linux/LinuxMouse.h> 39 #undef Success 39 40 #endif 40 41
Note: See TracChangeset
for help on using the changeset viewer.