Changeset 5910
- Timestamp:
- Oct 8, 2009, 9:47:28 PM (15 years ago)
- Location:
- code/branches/core5/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/external/ois/changes_orxonox.diff
r5738 r5910 23 23 24 24 25 --- win32/Win32ForceFeedback.cpp 26 +++ win32/Win32ForceFeedback.cpp 27 @@ -25,7 +25,7 @@ 28 #include <Math.h> 29 30 // 0 = No trace; 1 = Important traces; 2 = Debug traces 31 -#define OIS_WIN32_JOYFF_DEBUG 1 32 +#define OIS_WIN32_JOYFF_DEBUG 0 33 34 #if (defined (_DEBUG) || defined(OIS_WIN32_JOYFF_DEBUG)) 35 #include <iostream> -
code/branches/core5/src/external/ois/win32/Win32ForceFeedback.cpp
r5738 r5910 26 26 27 27 // 0 = No trace; 1 = Important traces; 2 = Debug traces 28 #define OIS_WIN32_JOYFF_DEBUG 128 #define OIS_WIN32_JOYFF_DEBUG 0 29 29 30 30 #if (defined (_DEBUG) || defined(OIS_WIN32_JOYFF_DEBUG)) -
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() -
code/branches/core5/src/orxonox/gamestates/GSLevel.cc
r5876 r5910 68 68 { 69 69 gameInputState_ = InputManager::getInstance().createInputState("game"); 70 gameInputState_->setMouseMode(MouseMode::Exclusive); 70 71 gameInputState_->setHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); 71 72 KeyBinderManager::getInstance().setToDefault(); 72 73 73 74 guiMouseOnlyInputState_ = InputManager::getInstance().createInputState("guiMouseOnly"); 75 guiMouseOnlyInputState_->setMouseMode(MouseMode::Exclusive); 74 76 guiMouseOnlyInputState_->setMouseHandler(GUIManager::getInstancePtr()); 75 77 -
code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc
r5899 r5910 50 50 { 51 51 inputState_ = InputManager::getInstance().createInputState("mainMenu"); 52 inputState_->setMouseMode(MouseMode::Nonexclusive); 52 53 inputState_->setHandler(GUIManager::getInstancePtr()); 53 54 inputState_->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); 54 55 inputState_->setJoyStickHandler(&InputHandler::EMPTY); 55 inputState_->setIsExclusiveMouse(false);56 56 57 57 // create an empty Scene
Note: See TracChangeset
for help on using the changeset viewer.