Changeset 8678 for code/branches/unity_build/src/libraries/core/input
- Timestamp:
- May 30, 2011, 2:38:34 AM (14 years ago)
- Location:
- code/branches/unity_build/src/libraries/core/input
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/unity_build/src/libraries/core/input/InputManager.cc
r8351 r8678 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/branches/unity_build/src/libraries/core/input/InputManager.h
r8672 r8678 38 38 39 39 #include "util/Singleton.h" 40 #include "util/ TriBool.h"40 #include "util/tribool.h" 41 41 #include "core/WindowEventListener.h" 42 42 … … 168 168 True if the call was successful, fals if the name was not found 169 169 */ 170 bool setMouseExclusive(const std::string& name, TriBool::Valuevalue); // tolua_export170 bool setMouseExclusive(const std::string& name, tribool value); // tolua_export 171 171 172 172 //------------------------------- … … 214 214 OIS::InputManager* oisInputManager_; //!< OIS input manager 215 215 std::vector<InputDevice*> devices_; //!< List of all input devices (keyboard, mouse, joy sticks) 216 TriBool::ValueexclusiveMouse_; //!< Currently applied mouse mode216 bool exclusiveMouse_; //!< Currently applied mouse mode 217 217 218 218 // some internally handled states and handlers -
code/branches/unity_build/src/libraries/core/input/InputState.cc
r7284 r8678 37 37 , bAlwaysGetsInput_(bAlwaysGetsInput) 38 38 , bTransparent_(bTransparent) 39 , exclusiveMouse_( TriBool::Dontcare)39 , exclusiveMouse_(dontcare) 40 40 , bExpired_(true) 41 41 , handlers_(2) -
code/branches/unity_build/src/libraries/core/input/InputState.h
r8351 r8678 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()
Note: See TracChangeset
for help on using the changeset viewer.