Changeset 5910 for code/branches/core5/src/libraries/core/input
- Timestamp:
- Oct 8, 2009, 9:47:28 PM (15 years ago)
- Location:
- code/branches/core5/src/libraries/core/input
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/input/InputManager.cc
r5869 r5910 87 87 , oisInputManager_(0) 88 88 , devices_(2) 89 , bExclusiveMouse_(false)89 , mouseMode_(MouseMode::Nonexclusive) 90 90 , emptyState_(0) 91 91 , calibratorCallbackHandler_(0) … … 97 97 this->setConfigValues(); 98 98 99 if (GraphicsManager::getInstance().isFullScreen()) 100 mouseMode_ = MouseMode::Exclusive; 99 101 this->loadDevices(); 100 102 … … 153 155 paramList.insert(std::make_pair("w32_keyboard", "DISCL_FOREGROUND")); 154 156 paramList.insert(std::make_pair("w32_mouse", "DISCL_FOREGROUND")); 155 if ( bExclusiveMouse_|| GraphicsManager::getInstance().isFullScreen())157 if (mouseMode_ == MouseMode::Exclusive || GraphicsManager::getInstance().isFullScreen()) 156 158 { 157 159 // Disable Windows key plus special keys (like play, stop, next, etc.) … … 502 504 503 505 // Check whether we have to change the mouse mode 506 MouseMode::Value requestedMode = MouseMode::Dontcare; 504 507 std::vector<InputState*>& mouseStates = devices_[InputDeviceEnumerator::Mouse]->getStateListRef(); 505 if (mouseStates.empty() && bExclusiveMouse_ || 506 !mouseStates.empty() && mouseStates.front()->getIsExclusiveMouse() != bExclusiveMouse_) 507 { 508 bExclusiveMouse_ = !bExclusiveMouse_; 508 if (mouseStates.empty()) 509 requestedMode = MouseMode::Nonexclusive; 510 else 511 requestedMode = mouseStates.front()->getMouseMode(); 512 if (requestedMode != MouseMode::Dontcare && mouseMode_ != requestedMode) 513 { 514 mouseMode_ = requestedMode; 509 515 if (!GraphicsManager::getInstance().isFullScreen()) 510 516 this->reloadInternal(); -
code/branches/core5/src/libraries/core/input/InputManager.h
r5869 r5910 191 191 OIS::InputManager* oisInputManager_; //!< OIS input manager 192 192 std::vector<InputDevice*> devices_; //!< List of all input devices (keyboard, mouse, joy sticks) 193 bool bExclusiveMouse_;//!< Currently applied mouse mode193 MouseMode::Value mouseMode_; //!< Currently applied mouse mode 194 194 195 195 // some internally handled states and handlers -
code/branches/core5/src/libraries/core/input/InputState.cc
r5738 r5910 37 37 , bAlwaysGetsInput_(bAlwaysGetsInput) 38 38 , bTransparent_(bTransparent) 39 , bExclusiveMouse_(true)39 , mouseMode_(MouseMode::Dontcare) 40 40 , bExpired_(true) 41 41 , handlers_(2) -
code/branches/core5/src/libraries/core/input/InputState.h
r5738 r5910 55 55 static const int Detector = HighPriority + 2; 56 56 }; 57 58 namespace MouseMode 59 { 60 enum Value 61 { 62 Exclusive, 63 Nonexclusive, 64 Dontcare 65 }; 66 } 57 67 58 68 /** … … 120 130 void setHandler (InputHandler* handler); 121 131 122 void set IsExclusiveMouse(bool value) { bExclusiveMouse_ = value; this->bExpired_ = true; }123 bool getIsExclusiveMouse() const { return bExclusiveMouse_; }132 void setMouseMode(MouseMode::Value value) { mouseMode_ = value; this->bExpired_ = true; } 133 MouseMode::Value getMouseMode() const { return mouseMode_; } 124 134 125 135 //! Returns the name of the state (which is unique!) … … 174 184 const bool bAlwaysGetsInput_; //!< See class declaration for explanation 175 185 const bool bTransparent_; //!< See class declaration for explanation 176 bool bExclusiveMouse_;//!< See class declaration for explanation186 MouseMode::Value mouseMode_; //!< See class declaration for explanation 177 187 int priority_; //!< Current priority (might change) 178 188 bool bExpired_; //!< See hasExpired()
Note: See TracChangeset
for help on using the changeset viewer.